Commit c7796682 by BellCodeEditor

auto save

parent 0a7b0048
Showing with 25 additions and 2 deletions
alist = [88, 75, 72, 82, 90, 85, 78, 91] alist = [88, 75, 72, 82, 90, 85, 78, 91]
\ No newline at end of file
n = len(alist)
#如果排好序就跳过剩余的循环
for i in range(0,n-1):#轮数
botton = False
for j in range(0,n-1-i):#每轮的次数
if alist[j] > alist[j+1]:#两两比较
botton = True
alist[j],alist[j+1] = alist[j+1],alist[j]#两两交换
if botton == False:
break
print(alist)#打印每轮交换之后的结果
a = 5
c = 3
b = 0
b = a
a = c
c = b
print(a,c)
\ No newline at end of file
print("hello world!")
\ 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