清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
[Python]代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | def maopao(list): for i in range( 0 , len(list)): for j in range(len(list) - 1 , i - 1 , - 1 ): if list[j] < list[j - 1 ]: temp = list[j] list[j] = list[j - 1 ] list[j - 1 ] = temp #printResult(list) def printResult(list): for i in range( 0 , len(list)): print list[i], print List = [ 9 , 1 , 7 , 3 , 8 , 2 , 6 , 4 , 0 ] maopao(List) print List |