Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_pythag?(a, b, c)
- return c == Math.sqrt( a + b )
- end
- def is_1000_sum?(a, b, c)
- return c + a + b == 1000
- end
- def answer
- a = b = c = 1
- until is_pythag?(a, b, c) and is_1000_sum?(a, b, c)
- 0..500.each do
- 0..500.each do
- 0..500.each do
- c += 1
- end
- b += 1
- end
- a += 1
- end
- return a * b * c
- end
Add Comment
Please, Sign In to add comment