728x90
반응형

기본적인 스택 문제이다.

from collections import deque

for case in range(int(input())):
    stack = deque(input().split())
    print(f"Case #{case+1}: ", end='')
    while len(stack) > 1:
        print(stack.pop(), end= ' ')
    print(stack.pop())
728x90
반응형

+ Recent posts