2013-09-05から1日間の記事一覧

rubyでRのorder

rubyでRのorder a=[5,2,3,1] (a.length).times.sort{|x,y| a[x] <=> a[y]} a=[5,2,3,1] b=[2,3,4,7] c=(a.length).times.sort{|x,y| a[x] <=> a[y]} c.each{|i| puts a[i].to_s+","+b[i].to_s}