arr = input().split('-')
s = 0
for i in arr[0].split('+'): #첫 - 이전에는 다 더 해준다.
s += int(i)
for i in arr[1:]: # 첫 - 이후는 다 더해서 빼준다.
for j in i.split('+'):
s -= int(j)
print(s)
'개발 > Algorithm' 카테고리의 다른 글
[Python] 백준 10814번 나이순 정렬 (0) | 2021.11.11 |
---|---|
[Python] 백준 1181번 단어 정렬 (0) | 2021.11.10 |
[Python] 백준 11399번 ATM (0) | 2021.11.09 |
[Python] 백준 1931번 회의실 배정 (0) | 2021.11.09 |
[Python] 백준 2798번 블랙잭 (0) | 2021.11.08 |
댓글