add: boj/1541.py
This commit is contained in:
17
boj/1541.py
Normal file
17
boj/1541.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
s=input()
|
||||||
|
|
||||||
|
smarr=s.split("-")
|
||||||
|
front=True
|
||||||
|
result=0
|
||||||
|
|
||||||
|
for i in smarr:
|
||||||
|
p=0
|
||||||
|
for j in i.split("+"):
|
||||||
|
p+=int(j)
|
||||||
|
if front:
|
||||||
|
result+=p
|
||||||
|
front=False
|
||||||
|
else:
|
||||||
|
result-=p
|
||||||
|
|
||||||
|
print(result)
|
||||||
Reference in New Issue
Block a user