project-euler/problem9.py

16 lines
299 B
Python
Raw Normal View History

2017-06-21 20:20:47 +00:00
from math import sqrt
def main():
a = 1
b = 1
c = 1
for c in range(1000):
for b in range(c):
for a in range(b):
if a + b + c == 1000:
if sqrt(a**2 + b**2) == c:
print(str(a) + ' ' + str(b) + ' ' + str(c))
print(a*b*c)
return