We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a049d36 commit 21daca2Copy full SHA for 21daca2
1 file changed
김지호/11주차/260313.py
@@ -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