num=0
max=0
c=0
x=0
L=[]
for a in range(1,1000):
for b in range(1,1000):
c=a**2+b**2
c=c**0.5
temp=c
temp=int(temp)
if temp==c and a+b+c<=1000:
num=a+b+temp
L.append(num)
n=len(L)
for i in range(n):
num=L.count(L[i])
if num>max:
max=num
x=L[i]
print x
转载于:https://my.oschina.net/u/923087/blog/279166