title:
A Pythagorean triplet is a set of three natural numbers,
, for which,
+ =
For example, 3 + 4 = 9 + 16 = 25 = 5.
There exists exactly one Pythagorean triplet for which + +
= 1000.
Find the product .
翻译:
勾股数组就是三个自然数:
+
=
=
比如,3 + 4 = 9 + 16 = 25 = 5。
现存在唯一的勾股数组,且 +
+
= 1000。请求出这三个数的乘积。
def resu():
for i in range(1,1000):
for j in range(1,1000):
k=1000-i-j
if i*i+j*j==k*k:
print i*j*k
return
resu()