How to write negative loop in ruby like for(i=index; i >= 0; i --)

前端 未结 7 1353
滥情空心
滥情空心 2020-12-25 10:42

How can I write a loop in Ruby that counts down, similar to the following C-style for loop?

for (i = 25; i >= 0; i--) { 
    print i;
}
         


        
7条回答
提交回复
热议问题