We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79ab7a8 commit aed54f2Copy full SHA for aed54f2
2015/Senior Problems/S1.py
@@ -0,0 +1,8 @@
1
+l=[]
2
+for t in range(int(input())):
3
+ c = int(input(''))
4
+ if c!=0:
5
+ l.append(c)
6
+ else:
7
+ l.pop(-1)
8
+print(sum(l))
0 commit comments