python sort algorithm1 정렬 알고리즘 #버블정렬list = []temp = ""input = ""count = 1for i in range(5): a = int(raw_input("Input Number : ")) print "a["+str(i)+"] = "+str(a) list.append(a)print "Before sort -> "+str(list) for i in range(len(list)-1): for j in range(0, len(list)-1-i): if(list[j]>list[j+1]): temp = list[j] list[j] = list[j+1] list[j+1] = temp print "i = "+str(i)+", j = "+str(j)+str(list) print "After sort -> "+str(list)---.. 2015. 3. 9. 이전 1 다음