Created
July 31, 2012 15:42
-
-
Save yuuki/3217929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..1000).each do |a| | |
(a..(1000 - a)).each do |b| | |
c = 1000 - a - b | |
puts a*b*c or exit if a**2 + b**2 == c**2 | |
end | |
end | |
# 31875000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment