Commit bc58ccaa by BellCodeEditor

save project

parent 0a7b0048
Showing with 44 additions and 2 deletions
import time
S_T=time.time()
print('开始时间约为',(S_T-S_T%1))
v=0
i=0
a = [88, 75, 72, 82, 90, 85, 78, 91]
for i in range(len(a)-1):
for v in range(len(a)-1-i):
if a[v]>a[v+1]:
a[v],a[v+1]=a[v+1],a[v]
print(a)
print('----------------------------')
print(a,i+1)
E_T=time.time()
print('结束时间约为',(E_T-E_T%1))
Use_Time=E_T-S_T
print('总耗时',Use_Time)
\ No newline at end of file
alist = [88, 75, 72, 82, 90, 85, 78, 91] import time
\ No newline at end of file
S_T=time.time()
print('开始时间约为',(S_T-S_T%1))
v=0
i=0
a = [88, 75, 72, 82, 90, 85, 78, 91]
for i in range(len(a)-1):
for v in range(i):
if a[v]>a[v+1]:
a[v],a[v+1]=a[v+1],a[v]
print(a)
print('----------------------------')
print(a,i+1)
E_T=time.time()
print('结束时间约为',(E_T-E_T%1))
Use_Time=E_T-S_T
print('总耗时',Use_Time)
\ 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