Ruby for

#!/usr/bin/ruby -w
# -*- coding: UTF-8 -*-
for i in 1..5
 print i," "
end
print "\n"
for i in 1...5
 print i," "
end
#
#1 2 3 4 5
#1 2 3 4
#

posted @ 2017-04-20 16:09  sky20080101  阅读(89)  评论(0编辑  收藏  举报