a = 0(100..999).each{|x|(100..999).each{|y| z = x*y a = z if z.to_s.reverse == z.to_s && a < z}}p a
Standard input is empty
906609
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!