SB.py
354 Bytes
import time
start_time=time.time()
print("开始时间为:"+str(start_time))
for a in range(0,1001):
for b in range(0,1001):
c=1000-a-b
if a**2+b**2==c**2 and a+b+c==1000:
print(a,b,c)
stop_time=time.time()
print("结束时间为:"+str(stop_time))
t=stop_time-start_time
print("所用时间为:"+str(t))