There was an error while loading. Please reload this page.
1 parent 0866b0a commit 5d46152Copy full SHA for 5d46152
1 file changed
JYP/제로.py
@@ -0,0 +1,11 @@
1
+num = int(input())
2
+a = []
3
+
4
+for i in range(num):
5
+ b = int(input())
6
7
+ if b == 0:
8
+ a.pop()
9
+ else:
10
+ a.append(b)
11
+print(sum(a))
0 commit comments