Commit 67a4031b by BellCodeEditor

save project

parent 39c2fd6e
Showing with 19 additions and 13 deletions
import time
a=time.time()
print('开始的时间为:',a)
list=[]
for a in range(0,1000):
for b in range(0,1000):
list.append(0)
b=time.time()
print('结束时间为: ',b)
c=b-a
print('总共耗时:',c)
\ No newline at end of file
import time a=[20,17,15,13,11,21]
start_time = time.time() b=len(a)
print('开始时间为',start_time) for i in range(0,b-1):
list1 = [] for j in range(0,b-1):
for a in range(0, 1000): if a[j]>a[j+1]:
for b in range(0, 1000): a[j],a[j+1] = a[j+1],a[j]
list1.insert(0, 0) print(a)
end_time=time.time()
print('结束时间为',end_time)
c=end_time-start_time
print('耗时时间为',c)
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