Algorithm/Simulation1 [백준] 2947번 나무조각 쉬운 문제.. def printList(L): for i in range(len(L)): print(L[i], end=" ") print() inputList = list(map(int, input().split())) sortedList = sorted(inputList) while inputList != sortedList: for i in range(len(inputList) - 1): if inputList[i] > inputList[i + 1]: temp = inputList[i + 1] inputList[i + 1] = inputList[i] inputList[i] = temp printList(inputList) 2020. 11. 27. 이전 1 다음