注意把最大的值放到最后以后,那个最大的值就不参与排序了。
原来的是:
li=[33,2,10,1]
for i in range(len(li)-1):
if li[i]>li[i+1]:
temp=li[i]
li[i]=li[i+1]
li[i+1]=temp