Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created July 31, 2012 15:42
Show Gist options
  • Save yuuki/3217929 to your computer and use it in GitHub Desktop.
Save yuuki/3217929 to your computer and use it in GitHub Desktop.
(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