Commit 7c34fdc4 by BellCodeEditor

auto save

parent 5c11f222
Showing with 9 additions and 6 deletions
import time import time
alist = [88,75,72,82,90,85,78,91]
list1 = [] n = len(alist)
start_time = time.time() start_time = time.time()
for a in range(0, 1000): for b in range(0,n-1):
for b in range(0, 1000): for a in range(0,n-1):
list1.append(0) if alist[a] < alist[a-1]:
alist[a],alist[a-1] = alist[a-1],alist[a]
print(alist)
end_time = time.time() end_time = time.time()
result = end_time - start_time result = end_time - start_time
print("总时间",result) print("总时间",result)
\ 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