http://www.thedisqisition.org/LESSONS/ruby_lesson23.html 运行下 rand rand(10) rand(100) rand(1000) 就可以知道了