标签:print 选择 int color pre nbsp 选择排序 length ==
nums = [1,9,8,5] print(nums) print("=========") length = len(nums) for i in range(length-1): maxindex = i for j in range(i+1,length): if nums[j] > nums[maxindex]: maxindex = j if i == maxindex: continue nums[i],nums[maxindex] = nums[maxindex],nums[i] print(nums) print("=========") print(nums)
标签:print 选择 int color pre nbsp 选择排序 length ==
原文地址:https://www.cnblogs.com/alrenn/p/12658705.html