알고리즘/백준
백준 10773 파이썬
푸딩코딩
2022. 9. 2. 14:37
728x90
반응형
k=int(input())
stack=[]
for i in range(k):
temp=int(input())
if(temp==0):
stack.pop()
else:
stack.append(temp)
sum(stack)
sum(stack)이 아니라
print(sum(stack))
728x90
반응형