Commit 8018736f by BellCodeEditor

auto save

parent dacdc647
Showing with 0 additions and 16 deletions
import time
alist = [88, 75, 72, 82, 90, 85, 78, 91]
s_time = time.time()
print("开始时间:",s_time)
n = len(alist)
for i in range(0,n-1):
for j in range(0,n-1):
if alist[j] > alist[j+1]:
alist[j],alist[j+1] = alist[j+1],alist[j]
print(alist)
e_time = time.time()
print("时间:",e_time)
print("结束时间:",e_time - s_time)
# 格式化成2016-03-20 11:45:39形式
print(time.strftime("%Y-%m-%d %H:%M:%S", e_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