Commit 4ed09028 by BellCodeEditor

save project

parent e27463f6
Showing with 8 additions and 13 deletions
import time alist=[8562486,4,14789459784,715,15,8,10,20,17,9,13,8,6]
a=time.time() n=len(alist)
print('开始时间是:',a) for i in range(0,n- 1):
for an in range(0,1001): for j in range(0,n-1):
for b in range(0,1001): if alist[j]>alist[j+1]:
c=1000-a-b alist[j],alist[j+1]=alist[j+1],alist[j]
if an**2+b**2==c**2 :
print('an,b,c的值分别为:',an,b,c print(alist)
e=time.time()
print('结束时间为:',e)
f=e-a
print('总共耗时:',f)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment