我当前的代码:
def create_1_to_100_odd_array array = [1] i = 3 while i < 100 array.push i i += 2 end array end
提前致谢
1.9.3-p286 :005 > (1..10).step(2).to_a => [1,3,5,7,9]