Commit 0b3fbfd2 by BellCodeEditor

auto save

parent e13d2402
Showing with 13 additions and 3 deletions
alist = [8456+87645546, 7654967, 268746, 36754687, 967, 58978, 6656, 16+5, 412, 1555555555555]
import time
start=time.time()
print("开始时间是"+str(start)'秒')
alist = [1,2,3,8,6,5,4,9,4,6,4,1,2,5,9,3,7,3,6,1,7,9,8,8,7,2,5]
cd=len(alist)
for k in range(cd-1):
for i in range(cd-k-1):
if alist[i]>alist[i+1]:
if alist[i]<alist[i+1]:
# t=alist[i]
# alist[i]=alist[i+1]
# alist[i+1]=t
alist[i],alist[i+1]=alist[i+1],alist[i]
print(alist)
js=time.time()
print(js)
alist[i],alist[i+1]=alist[i+1],alist[i]
sj=js-start
print(alist)
print("用了",sj'秒')
\ 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