문제
(구름level) 큐
Python 풀이
a = int(input()) # 횟수
b = [] # 백업
for i in range(a):
s = input() # 선택
if s == 'e' or s == 'E':
if len(b) < 10:
n = int(input()) # 입력
b.append(n)
else:
print('overflow')
elif s == 'd' or s == 'D':
if len(b) > 0:
b.pop(0)
else:
print('underflow')
else:
break
t = ""
for k in b:
t += str(k) + " "
print(t.strip())