times 循环
控制流 / 循环
each 循环
for-in 循环
each_with_index 循环
while 循环
do-while 循环
until 循环
upto 循环
step 循环
times 循环
无限循环
5
.
times
{|i|
puts
"
#{i}
^3 =
#{i**
3
}
"
}
# 0^3 = 0
# 1^3 = 1
# 2^3 = 8
# 3^3 = 27
# 4^3 = 64