rubyのarrayのeachで代入する方法を教えて下さい ary = [[10,15,'s'], [20,25], [30,35]] ary.each do |elm1, elm2, elm3| elm1=elm1/5 end p ary `[[10, 15, "s"], [20, 25], [30, 35]]` `[[2, 15, "s"], [4, 25], [6, 35]]`
BLUEPIXY `map!`
ary.map! {|a| [ a[0]/5, *a.drop(1) ] }
xcX3v84RxoQ-4GxG32940ukFUIEgYdPy
38a4d9a3a88b29f2fdf854a50e277937
Stop