其他分享
首页 > 其他分享> > 找三个数吧,a+b+c=1000,and a^2+b^2=c^2

找三个数吧,a+b+c=1000,and a^2+b^2=c^2

作者:互联网

#if u want three num when a+b+c=1000,and a^2+b^2=c^2

import os
import time

start_time = time.time()
for a in range(0,1001):
for b in range(0,1001):
for c in range(0,1001):
if a + b + c == 1000 and a**2 + b**2 == c**2:
print("a,b,c:%d,%d,%d" %(a,b,c))
end_time = time.time()
print("all time: %d" %(end_time-start_time))

 

标签:end,start,range,三个,time,1001,1000
来源: https://www.cnblogs.com/KingOfHuan/p/16404405.html