[ruby] 语句修饰符

if r>10
    puts 'hello'
end

等价于

puts 'hello' if r>10

square=2
while square<10
    square=square*square
end

等价于

square=2
square=square*square while square<10

推荐阅读更多精彩内容