Skip to content

Commit 21daca2

Browse files
authored
[BOJ] 10773 제로 (S4)
1 parent a049d36 commit 21daca2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

김지호/11주차/260313.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
K = int(input())
2+
3+
stack = []
4+
5+
for _ in range(K) :
6+
N = int(input())
7+
if N == 0 :
8+
stack.pop()
9+
else :
10+
stack.append(N)
11+
12+
print(sum(stack))

0 commit comments

Comments
 (0)