title:

A Pythagorean triplet is a set of three natural numbers, projecteuler---->problem=9----Special Pythagorean triplet-LMLPHP
projecteuler---->problem=9----Special Pythagorean triplet-LMLPHP
, 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()

04-24 21:11