Commit dd0ec451 by BellCodeEditor

save project

parent 92449b0c
Showing with 19 additions and 0 deletions
a=[2,1,5,4,3]
n=len(a)
count=0
for i in range(n-1):
flag=1
for j in range(n-1):
if a[j] > a[j+1]:
flag=0
c=a[j]
a[j]=a[j+1]
a[j+1]=c
if flag==1:
#print("第",count,"轮的结果是:"a)
break
else:
count+=1
print("第",count,"轮的结果是:",a)
\ 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