Accounting
This commit is contained in:
20
bokforing.py
Normal file
20
bokforing.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
n, q = map(int, input().split(" "))
|
||||||
|
d = 0
|
||||||
|
p = {}
|
||||||
|
for _ in range(q):
|
||||||
|
e = input().strip()
|
||||||
|
|
||||||
|
if e[:3] == "SET":
|
||||||
|
i, x = map(int, e[4:].split(" "))
|
||||||
|
p[i] = x
|
||||||
|
|
||||||
|
elif e[:5] == "PRINT":
|
||||||
|
i = int(e[6:])
|
||||||
|
try:
|
||||||
|
print(p[i])
|
||||||
|
except KeyError:
|
||||||
|
print(d)
|
||||||
|
|
||||||
|
elif e[:7] == "RESTART":
|
||||||
|
d = int(e[8:])
|
||||||
|
p = {}
|
||||||
Reference in New Issue
Block a user