2015-09-09 (0..9).each Ruby (0..9)ね。 (0..9).each{|i| puts format("%04d",i) } 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009