지나가던 개발자
[Python] 백준 10773번(제로) 문제 풀이 본문
stack = []
for i in range(int(input())):
n = int(input())
if n == 0:
stack.pop()
continue
stack.append(n)
print(sum(stack))
'PS > Python' 카테고리의 다른 글
[Python] 백준 10174번(팰린드롬) 문제 풀이 (0) | 2022.12.10 |
---|---|
[Python] 백준 11365번(!밀비 급일) 문제 풀이 (0) | 2022.12.10 |
[Python] 백준 10828번(스택) 문제 풀이 (0) | 2022.12.09 |
[Python] 백준 4949번(균형잡힌 세상) 문제 풀이 (0) | 2022.12.08 |
[Python] 백준 9012번(괄호) 문제 풀이 (0) | 2022.12.08 |
Comments