Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / level3-lesson13-diy2

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit bc58ccaa authored 2 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 0a7b0048
Hide whitespace changes
Inline Side-by-side
Showing with 44 additions and 2 deletions
  • a.py
  • diy2.py
a.py 0 → 100644
View file @ bc58ccaa
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
This diff is collapsed. Click to expand it.
diy2.py
View file @ bc58ccaa
alist = [88, 75, 72, 82, 90, 85, 78, 91]
\ No newline at end of file
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(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
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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