2025 J2 - Donut Shop

Easyimplementationsimple math

1 Solution Available

Solution 1

PYTHON
1#  By WATER on 2025-03-02
2
3D=int(input())
4E=int(input())
5
6
7for _ in range(E):
8    e=input()
9    Q=int(input())
10
11
12    if e=="+":
13        D+=Q
14    elif e=='-':
15        D-=Q
16
17
18print(D)
19

Test Cases

Select a test case to view input and output