BOJ - 2947 - 나무 조각

Updated:

def solution():
    
    data = list(map(int, input().split(' ')))

    for i in range(len(data)):
        for j in range(len(data) - 1):
            if data[j] > data[j+1]:
                temp = data[j]
                data[j] = data[j+1]
                data[j+1] = temp
                print("{0} {1} {2} {3} {4}".format(data[0], data[1], data[2], data[3], data[4]))

solution()

https://www.acmicpc.net/problem/2947

Categories:

Updated:

Leave a comment