codingtests/ProjectEuler/004/solve.rb
2012-03-01 14:01:08 +01:00

10 lines
182 B
Ruby

max = 0;
(100..1000).each do |num1|
(100..1000).each do |num2|
sum = num1 * num2
if( sum > max and sum.to_s.reverse == sum.to_s)
max = sum
end
end
end
print max