a=gets.to_i\x0d puts (0..10).map{|i|(0..6).map{|m|10**m}.map{|j|j*i}}.flatten.uniq.sort.reverse.select{|i|i<=a}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page