Project Euler question #9 solved using Ruby
By Steve Claridge on 2014-03-15.
My first ever Ruby script. I'm sure this can be done neater using a list comprehension, but it works, so....
for a in (1..1000)
for b in (1..1000)
for c in (1..1000)
if (a*a + b*b == c*c)
if (a+b+c == 1000)
print "got = " + (a*b*c).to_s + "\n"
exit
end
end
end
end
end