-
-
Save JoshuaJWilborn/4277477 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
include Math | |
class Fixnum | |
def sqrt | |
Math.sqrt(self) | |
end | |
end | |
puts (1..(1001.sqrt.ceil)).find{ |a| ((a.succ)..1001.sqrt.ceil).find{ |b| ((b.succ)..1000).find{|c| (a + b == c) && (a**2+b**2==c**2) && c == 1000 }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment