# 1640276, 2022-09-24 09:52:53, ----- (0%)
cmd = input()
num = []
order = []
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
num.append(int(cmd[i]))
else :
order += cmd[i]
print(num)
print(order)
ans = 0
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
print(ans)
| # 1640728, 2022-09-24 10:05:40, ----- (0%)
cmd = input()
cmdd = ''
num = []
order = ''
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in list(cmdd)]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1640798, 2022-09-24 10:07:20, xxxxx (0%)
cmd = input()
cmdd = ''
num = []
order = ''
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1640872, 2022-09-24 10:09:02, xPPPx (60%)
cmd = input()
cmdd = ''
num = []
order = ''
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1641098, 2022-09-24 10:15:19, PPPP- (80%)
cmd = input()
cmdd = ''
num = []
order = ''
if cmd[0] == '-' :
order += cmd[0]
for i in range(1,len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = 0
for i in range(len(order)-1) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
print(ans)
else :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1641989, 2022-09-24 10:32:30, xPPPx (60%)
cmd = input()
cmdd = ''
num = []
order = ''
if type(cmd) == str :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1642014, 2022-09-24 10:32:59, PPPP- (80%)
cmd = input()
cmdd = ''
num = []
order = ''
if cmd[0] == '-' :
order += cmd[0]
for i in range(1,len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = 0
for i in range(len(order)-1) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
print(ans)
else :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1642316, 2022-09-24 10:37:18, -PPPP (80%)
cmd = input()
cmdd = ''
num = []
order = ''
if cmd[0] == '-' :
for i in range(1,len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = 0
if len(num) == 1 :
ans -= num[0]
else :
for i in range(len(order)-1) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
if order[-1] == '+' :
ans += num[-1]
else :
ans -= num[-1]
print(ans)
else :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1642377, 2022-09-24 10:38:00, compilation error (0%)
cmd = input()
cmdd = ''
num = []
order = ''
if cmd[0] == '-' :
for i in range(1,len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = 0
if len(num) == 1 :
ans -= num[0]
else :
for i in range(len(order)-1) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
if order[-1] == '+' :
ans += num[-1]
else :
ans -= num[-1]
print(ans)
else :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
| # 1642450, 2022-09-24 10:38:51, PPPPP (100%)
cmd = input()
cmdd = ''
num = []
order = ''
if cmd[0] == '-' :
for i in range(1,len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = 0
if len(num) == 1 :
ans -= num[0]
else :
for i in range(len(order)-1) :
if order[i] == '+' :
ans += num[i]
else :
ans -= num[i]
if order[-1] == '+' :
ans += num[-1]
else :
ans -= num[-1]
print(ans)
else :
for i in range(len(cmd)) :
if cmd[i] not in ['+','-'] :
cmdd += cmd[i]
else :
cmdd += ' '
for i in range(len(cmd)) :
if cmd[i] in ['+','-'] :
order += cmd[i]
num = [int(e) for e in cmdd.split()]
ans = num[0]
for i in range(len(order)) :
if order[i] == '+' :
ans += num[i+1]
else :
ans -= num[i+1]
print(ans)
|
# 1639593, 2022-09-24 09:34:17, Pxxxx (20%)
A=input().split('+')
for i in range(1,len(A)):
if '-' in A[i]:
A[i]=''
A.split()
S=0
for i in range(len(A)):
S+=float(A[i])
S=int(S)
print(S)
| # 1640427, 2022-09-24 09:57:32, ----- (0%)
#A=input().split('+')
A='-1-2-3-4-5'
A.split('+')
B=[]
p=''
c=0
if A[0] =='-':
c=1
A=A[1:]
p=p+A[0]
for i in range(1,len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
if A[len(A)-2]=='+':
B.append(p)
elif A[len(A)-2]=='-':
p='-'+p
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
Ans=sum(B)
print(Ans)
| # 1640432, 2022-09-24 09:57:45, ----- (0%)
A=input().split('+')
B=[]
p=''
c=0
if A[0] =='-':
c=1
A=A[1:]
p=p+A[0]
for i in range(1,len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
if A[len(A)-2]=='+':
B.append(p)
elif A[len(A)-2]=='-':
p='-'+p
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
Ans=sum(B)
print(Ans)
| # 1640491, 2022-09-24 09:59:14, ----- (0%)
A=input()
B=[]
p=''
c=0
if A[0] =='-':
c=1
A=A[1:]
p=p+A[0]
for i in range(1,len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
if A[len(A)-2]=='+':
B.append(p)
elif A[len(A)-2]=='-':
p='-'+p
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
Ans=sum(B)
print(Ans)
| # 1640943, 2022-09-24 10:10:57, ----- (0%)
A=input()+'x'
B=[]
p=''
s=0
if A[0]=='-':
A=A[1:]
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
elif A[0]=='+':
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
else:
for i in range(len(A)-1):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
if A[i+1]=='x':
B.append(p)
p=''
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
Ans=-sum(B)
print(Ans)
| # 1640953, 2022-09-24 10:11:15, ----- (0%)
A=input()+'x'
B=[]
p=''
s=0
if A[0]=='-':
A=A[1:]
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
elif A[0]=='+':
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
else:
for i in range(len(A)-1):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
if A[i+1]=='x':
B.append(p)
p=''
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
Ans=sum(B)
print(Ans)
| # 1641038, 2022-09-24 10:13:28, x-P-- (20%)
A=input()+'x'
B=[]
p=''
s=0
c=0
if A[0]=='-':
c=1
A=A[1:]
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
elif A[0]=='+':
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
else:
for i in range(len(A)-1):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
if A[i+1]=='x':
B.append(p)
p=''
elif A[i]=='-':
B.append(p)
p=''
p='-'+p
else:
B.append(p)
for i in range(len(B)):
B[i]=int(B[i])
if c==1:
B[0]=-int(B[0])
Ans=sum(B)
print(Ans)
| # 1641099, 2022-09-24 10:15:20, xPPP- (60%)
A=input()+'x'
B=[]
p=''
s=0
c=0
if A[0]=='-':
c=1
A=A[1:]
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
p=''
elif A[0]=='+':
for i in range(len(A)):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
elif A[i]=='-':
p='-'+p
B.append(p)
p=''
else:
B.append(p)
else:
for i in range(len(A)-1):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
if A[i+1]=='x':
B.append(p)
p=''
elif A[i]=='-':
B.append(p)
p=''
p='-'+p
else:
B.append(p)
p=''
for i in range(len(B)):
B[i]=int(B[i])
if c==1:
B[0]=-int(B[0])
Ans=sum(B)
print(Ans)
| # 1641146, 2022-09-24 10:16:23, PPPPP (100%)
A=input()+'x'
B=[]
p=''
s=0
c=0
if A[0]=='-':
c=1
A=A[1:]
for i in range(len(A)-1):
if A[i] != '+' and A[i] != '-':
p=p+A[i]
if A[i+1]=='x':
B.append(p)
p=''
elif A[i]=='-':
B.append(p)
p=''
p='-'+p
else:
B.append(p)
p=''
for i in range(len(B)):
B[i]=int(B[i])
if c==1:
B[0]=-int(B[0])
Ans=sum(B)
print(Ans)
|
# 1639341, 2022-09-24 09:28:00, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d-= 1
else :
if c % 2 == 0 :
d = d + a
else :
if d > c :
c = c +d
else :
b = b + a
a = b + c
print(a,b,c,d)
| # 1639381, 2022-09-24 09:29:01, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d-= 1
else :
if c % 2 == 0 :
d = d + a
else :
if d > c :
c = c +d
else :
b = b + a
a = b + c
print(a,b,c,d)
| # 1639409, 2022-09-24 09:29:41, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d-= 1
else :
if c % 2 == 0 :
d = d + a
else :
if d > c :
c = c +d
else :
b = b + a
a = b + c
print(a,b,c,d)
| # 1639439, 2022-09-24 09:30:26, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d-= 1
else :
if c % 2 == 0 :
d = d + a
else :
if d > c :
c = c +d
else :
b = b + a
a = b + c
print(a,b,c,d)
| # 1640277, 2022-09-24 09:52:59, PPPPP (100%)
n = input()
sign = []
nu = ''
num = []
c = 0
for i in range (len(n)) :
if n[i] == "+" or n[i] == "-" :
if len(nu) == 0 :
num.append(0)
sign.append(n[i])
else :
num.append(int(nu))
sign.append(n[i])
nu = ''
else :
nu += n[i]
num.append(int(nu))
i = 1
for x in sign :
if x == '+':
c += num[i]
else :
c -= num[i]
i += 1
if len(sign) == 0 :
print(num[0])
elif n[0] == '-' :
print(c - num[0])
else:
print(c + num[0])
| # 1641759, 2022-09-24 10:28:25, ----- (0%)
n = input()
n += ' '
c = 0
a = ''
print(int("3 "))
if '0' <= n[0] <= '9' :
a = '+'
for i in range (len(n)-1) :
a += n[i]
if (('-' in a or '+' in a ) and n[i+1] in ['-','+']) or n[i+1] == " " :
if a[0] == '+' :
c += int(a[1:])
else :
c += int(a)
a = ''
print(c)
| # 1641789, 2022-09-24 10:29:00, PPPPP (100%)
n = input()
sign = []
nu = ''
num = []
c = 0
for i in range (len(n)) :
if n[i] == "+" or n[i] == "-" :
if len(nu) == 0 :
num.append(0)
sign.append(n[i])
else :
num.append(int(nu))
sign.append(n[i])
nu = ''
else :
nu += n[i]
num.append(int(nu))
i = 1
for x in sign :
if x == '+':
c += num[i]
else :
c -= num[i]
i += 1
if len(sign) == 0 :
print(num[0])
elif n[0] == '-' :
print(c - num[0])
else:
print(c + num[0])
| # 1641844, 2022-09-24 10:29:53, PPPPP (100%)
n = input()
n += ' '
c = 0
a = ''
if '0' <= n[0] <= '9' :
a = '+'
for i in range (len(n)-1) :
a += n[i]
if (('-' in a or '+' in a ) and n[i+1] in ['-','+']) or n[i+1] == " " :
if a[0] == '+' :
c += int(a[1:])
else :
c += int(a)
a = ''
print(c)
|
# 1640967, 2022-09-24 10:11:39, -x--- (0%)
s = input()
# i = 0
# res = 0
# st = 0
# ed = 0
# # 9999-999+99-9
# # -1-2-3-4-5
# while i < len(s):
# if s[i] != '-' or s[i] != '+':
# ed += 1
# if s[st] != '-':
# res += int(s[st+1:ed])
# else:
# res -= int(s[st:ed])
# st = ed
# # res += int(s[st:ed])
# i += 1
# print(res)
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
print(s)
print(tmp)
print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
if i == 1:
res -= int(tmp[i])
elif i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1640978, 2022-09-24 10:11:55, PxPP- (60%)
s = input()
# i = 0
# res = 0
# st = 0
# ed = 0
# # 9999-999+99-9
# # -1-2-3-4-5
# while i < len(s):
# if s[i] != '-' or s[i] != '+':
# ed += 1
# if s[st] != '-':
# res += int(s[st+1:ed])
# else:
# res -= int(s[st:ed])
# st = ed
# # res += int(s[st:ed])
# i += 1
# print(res)
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
# print(s)
# print(tmp)
# print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
if i == 1:
res -= int(tmp[i])
elif i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641227, 2022-09-24 10:18:09, PxPP- (60%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
# print(s)
# print(tmp)
# print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
if i == 1:
res -= int(tmp[i])
elif i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641351, 2022-09-24 10:20:29, -x--- (0%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
print(s)
print(tmp)
print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
# if i == 1:
# res -= int(tmp[i])
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641361, 2022-09-24 10:20:44, PxPPP (80%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
# print(s)
# print(tmp)
# print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
# if i == 1:
# res -= int(tmp[i])
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641513, 2022-09-24 10:23:55, PP--P (60%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
# if i == 1:
# res -= int(tmp[i])
if i == minus[ind] and len(minus) > 0:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if len(minus) > 0:
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641576, 2022-09-24 10:24:55, PP--- (40%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
# print(s)
# print(tmp)
# print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
# if i == 1:
# res -= int(tmp[i])
if len(minus) > 0:
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if len(minus) > 0:
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
print(res)
| # 1641630, 2022-09-24 10:26:00, PPPPP (100%)
s = input()
if '-' not in s and '+' not in s:
print(s)
else:
res = 0
minus = []
cnt = 1
for i in range(len(s)):
if s[i] == '-':
minus.append(cnt)
if s[i] == '-' or s[i] == '+':
cnt += 1
tmp = []
s = s.split('-')
for i in range(len(s)):
if '+' in s[i]:
s[i] = s[i].split('+')
for j in range(len(s[i])):
tmp.append((s[i][j]))
else:
tmp.append((s[i]))
# print(s)
# print(tmp)
# print(minus)
ind = 0
if tmp[0] == '':
for i in range(1, len(tmp)):
# if i == 1:
# res -= int(tmp[i])
if len(minus) > 0:
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
res += int(tmp[i])
else:
for i in range(len(tmp)):
if len(minus) > 0:
if i == minus[ind]:
res -= int(tmp[i])
ind += 1
else:
res += int(tmp[i])
else:
res += int(tmp[i])
print(res)
|
# 1640389, 2022-09-24 09:56:33, xPPPx (60%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = True
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s== False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
else :
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1640598, 2022-09-24 10:02:07, P---P (40%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
else :
if i == '+' :
s = True
elif i == '-' :
s = False
else :
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1640645, 2022-09-24 10:03:27, P---P (40%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == None :
if i == '+' :
s = True
elif i == '-' :
s = False
else :
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1640971, 2022-09-24 10:11:45, xP--x (20%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == None :
if k == '+' :
s = True
elif k == '-' :
s = False
else :
if s == None :
for o in data :
if o in sign :
if o == '+' :
s = True
break
elif o == '-' :
s = False
break
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1641016, 2022-09-24 10:12:59, xP--x (20%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == None :
if k == '+' :
s = True
elif k == '-' :
s = False
else :
if s == None :
for o in data :
if o in sign :
if o == '+' :
s = True
break
elif o == '-' :
s = False
break
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1641114, 2022-09-24 10:15:41, PP--P (60%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
else :
if i == '+' :
s = True
elif i == '-' :
s = False
else :
if s == None:
for k in data:
if k in sign:
if k == '+':
s = True
else :
s = False
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
| # 1641198, 2022-09-24 10:17:30, PPPPP (100%)
sign = '+-'
data = str(input())
a = 0
b = 0
s = None
ans = ''
for i in data :
if i in sign :
if s == True :
a += int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
elif s == False :
a -= int(ans)
ans = ''
if i == '+' :
s = True
elif i == '-' :
s = False
else :
if i == '+' :
s = True
elif i == '-' :
s = False
else :
if s == None:
for k in data:
if k in sign:
s = True
ans += i
if s == True :
a += int(ans)
elif s == False :
a -= int(ans)
print(a)
|
# 1640993, 2022-09-24 10:12:27, xPPPx (60%)
d = str(input())
a = d[0]
out = []
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641053, 2022-09-24 10:13:55, xPPPx (60%)
d = str(input())
a = d[0]
out = []
if len(d) <= 3 :
print(int(d))
else :
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641162, 2022-09-24 10:16:46, P---P (40%)
d = str(input())
out = []
if len(d) <= 3 :
print(int(d))
else :
for e in d[1:] :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641233, 2022-09-24 10:18:16, compilation error (0%)
d = str(input())
a = d[0]
out = []
if len(d) <= 3 :
print(int(d))
else :
if a == "-"
for e in d[1:] :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
else :
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641253, 2022-09-24 10:18:39, compilation error (0%)
d = str(input())
a = d[0]
out = []
if len(d) <= 3 :
print(int(d))
else :
if a == "-"
for e in d[1:] :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
else :
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641284, 2022-09-24 10:19:13, PPPPP (100%)
d = str(input())
a = d[0]
out = []
if len(d) <= 3 :
print(int(d))
else :
if a == "-" :
for e in d[1:] :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
else :
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
| # 1641352, 2022-09-24 10:20:30, PPPPP (100%)
d = str(input())
a = d[0]
out = []
if len(d) <= 3 :
print(int(d))
#-------------------------------------------------------#
else :
if a == "-" :
for e in d[1:] :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
else :
for e in d :
if e in ["+","-"] :
e == " "
out.append(e)
#print(out)
da = [] ; k = " " ; o = []
for i in range (len(out)) :
if out[i] in ['0','1','2','3','4','5','6','7','8','9'] :
k += out[i]
else :
k += " "
o.append(out[i])
y = k.split()
new = []
for i in range (len(y)) :
new.append(int(y[i]))
#-------------------------------------------------------#
#print(new)
#print(o)
if d[0] != "-" :
s = [int(new[0])]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
else :
s = [int(new[0])*(-1)]
for i in range(len(o)) :
s.append(int(str(o[i])+str(new[i+1])))
print(sum(s))
|
# 1638876, 2022-09-24 09:17:13, xxxxx (0%)
x = input().split()
for i in range(len(x)) :
x[i] = int(x[i])
a, b, c, d = x[0], x[1], x[2], x[3]
print(a, b, c, d)
if a > b :
a, b = b, a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else :
if c % 2 != 0 :
if d > c :
c += d
else :
b += a
a = b + c
else :
d += a
print(a, b, c, d)
| # 1638899, 2022-09-24 09:17:36, xxxxx (0%)
x = input().split()
for i in range(len(x)) :
x[i] = int(x[i])
a, b, c, d = x[0], x[1], x[2], x[3]
if a > b :
a, b = b, a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else :
if c % 2 != 0 :
if d > c :
c += d
else :
b += a
a = b + c
else :
d += a
print(a, b, c, d)
| # 1638959, 2022-09-24 09:19:01, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a, b = b, a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else :
if c % 2 != 0 :
if d > c :
c += d
else :
b += a
a = b + c
else :
d += a
print(a, b, c, d)
| # 1638969, 2022-09-24 09:19:10, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a, b = b, a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else :
if c % 2 != 0 :
if d > c :
c += d
else :
b += a
a = b + c
else :
d += a
print(a,b,c,d)
| # 1639105, 2022-09-24 09:22:12, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a, b = b, a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else :
if c % 2 == 0 :
d += a
else :
if d > c :
c += d
else :
b += a
a = b + c
print(a,b,c,d)
| # 1641180, 2022-09-24 10:17:12, ----- (0%)
x = input()
ans = []
num = x[0]
for i in range(1, len(x)) :
if x[i] != '+' and x[i] != '-' :
num += x[i]
print(num)
elif x[i] == '-' :
ans.append(int(num))
num = ''
num += x[i]
else :
ans.append(int(num))
num = ''
ans.append(int(num))
print(sum(ans))
| # 1641214, 2022-09-24 10:17:52, PPPPP (100%)
x = input()
ans = []
num = x[0]
for i in range(1, len(x)) :
if x[i] != '+' and x[i] != '-' :
num += x[i]
elif x[i] == '-' :
ans.append(int(num))
num = ''
num += x[i]
else :
ans.append(int(num))
num = ''
ans.append(int(num))
print(sum(ans))
|
# 1639173, 2022-09-24 09:23:55, ----- (0%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
s = input()
mode = 1
sum = 0
for i in range(0, len(s)):
if s[i] not in ['+', '-']:
num = ''
for j in range(i, len(s)):
if s[j].isdigit():
num += s[j]
else:
break
if num != '':
sum += mode*int(num)
elif s[i] == '+':
mode = 1
elif s[i] == '-':
mode = -1
print(sum)
| # 1639610, 2022-09-24 09:34:41, P---P (40%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
s = input()
mode = 1
sum = 0
for i in range(0, len(s)):
if s[i] not in ['+', '-'] and not s[i-1].isdigit():
num = ''
for j in range(i, len(s)):
if s[j].isdigit():
num += s[j]
else:
break
if num != '':
sum += mode*int(num)
elif s[i] == '+':
mode = 1
elif s[i] == '-':
mode = -1
print(sum)
| # 1639726, 2022-09-24 09:37:49, P---P (40%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
s = input()
mode = 1
sum = 0
for i in range(0, len(s)):
if s[i] not in ['+', '-'] and not s[i-1].isdigit():
num = ''
for j in range(i, len(s)):
if s[j].isdigit():
num += s[j]
else:
break
if num != '':
sum += mode*int(num)
# print(num, mode)
elif s[i] == '+':
mode = 1
elif s[i] == '-':
mode = -1
print(sum)
| # 1639782, 2022-09-24 09:39:11, PPPPP (100%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
s = '+'+input()
mode = 1
sum = 0
for i in range(0, len(s)):
if s[i] not in ['+', '-'] and not s[i-1].isdigit():
num = ''
for j in range(i, len(s)):
if s[j].isdigit():
num += s[j]
else:
break
if num != '':
sum += mode*int(num)
elif s[i] == '+':
mode = 1
elif s[i] == '-':
mode = -1
print(sum)
| # 1639988, 2022-09-24 09:44:45, xPPPx (60%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
# s = '+'+input()
# mode = 1
# sum = 0
# for i in range(0, len(s)):
# if s[i] not in ['+', '-'] and not s[i-1].isdigit():
# num = ''
# for j in range(i, len(s)):
# if s[j].isdigit():
# num += s[j]
# else:
# break
# if num != '':
# sum += mode*int(num)
# elif s[i] == '+':
# mode = 1
# elif s[i] == '-':
# mode = -1
# print(sum)
s = '+' + input()
ls = s.replace('+', ',+').replace('-', ',-').split(',')
ans = 0
for x in ls[1:]:
if x[0] == '+':
ans += int(x[1:])
elif x[0] == '-':
ans -= int(x[1:])
print(ans)
| # 1640008, 2022-09-24 09:45:41, PPPPP (100%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
# s = '+'+input()
# mode = 1
# sum = 0
# for i in range(0, len(s)):
# if s[i] not in ['+', '-'] and not s[i-1].isdigit():
# num = ''
# for j in range(i, len(s)):
# if s[j].isdigit():
# num += s[j]
# else:
# break
# if num != '':
# sum += mode*int(num)
# elif s[i] == '+':
# mode = 1
# elif s[i] == '-':
# mode = -1
# print(sum)
s = input()
if s[0] != '-':
s = '+' + s
ls = s.replace('+', ',+').replace('-', ',-').split(',')
ans = 0
for x in ls[1:]:
if x[0] == '+':
ans += int(x[1:])
elif x[0] == '-':
ans -= int(x[1:])
print(ans)
| # 1640037, 2022-09-24 09:46:26, PPPPP (100%)
# "Sakura no Uta" by Hana
# From Visual Novel "Sakura no Uta" by Makura
# Kanji
# 奔る光の螺旋
# 吹き上がる音と言葉の即興劇
# 櫻の刻を奏でよ 始まりへ
# 風の筆 射す 春日花抄
# その力に身をまかせよう
# 恐れなどいらない
# 足が立つこの大地 櫻舞う
# 歌声はあなたに響くだろうか
# 世界の限界を超える詩を
# この筆にのせて とどけよ
# 私を越えて
# 櫻咲く この森で
# 舞い上がる因果交流のひかり
# きらめくいろにせかいが結ばれる
# 春の雪 そら たかく舞い散る
# 消え去る花かがやく息吹き
# 君が立つ大地だ 花よ咲け 咲き乱れ
# 光射す
# あらわれる心象をスケッチしよう
# せかいの限界をこえる絵画
# 標本の蝶々
# よみがえりまた飛び立つ
# すばらしき刻
# 瞬間を閉じこめた永遠こそ
# わたしたちの意味 そして意義だと
# 君は知るだろう
# さぁ うけとるがいい
# 永遠の相 この櫻ノ詩の下
# Hashiru hikari no rasen
# Fukiagaru oto to kotoba no ECHUUDO
# Sakura no toki wo kanade yo hajimari e
# Kaze no fude sasu shunjitsu kashou
# Sono chikara ni mi wo makaseyou
# Osore nado iranai
# Ashi ga tatsu kono daichi sakura mau
# Utagoe wa anata ni hibiku darou ka
# Sekai no genkai wo koeru uta wo
# Kono fude ni nosete todoke yo
# Watashi wo koete
# Spiraling lights, beaming through the seams,
# A gust of wind plays the tune, a start of the Etude.
# O Sakura tree, start your symphony.
# The wind bathes her spring flowers light
# Believe in her power, let faith take control
# There is no need to be scared
# Stand firm, here in our world, the Sakura tree dances
# Will our voices reach you?
# A poem that transcends the limits of this world
# Putting down this brush, reach them!
# Beyond my limits
# Sakura saku kono mori de
# Maiagaru inga kouryuu no hikari
# Kirameku iro ni sekai ga musubareru
# Haru no yuki sora takaku maichiru
# Kiesaru hana kagayaku ibuki
# Kimi ga tatsu daichi da hana yo sake sakimidare
# Hikari sasu
# Arawareru shinshou wo SUKECCHI shiyou
# Sekai no genkai wo koeru kaiga
# Hyouhon no chouchou
# Yomigaeri mata tobitatsu
# The cherry blossoms, blooming in this forest,
# the petals flickering the light passing through,
# the glittering colours, the worlds start to blur.
# The petals falling like spring snow from the sky,
# they will also disappear as the light shines through.
# You stand over there, surrounded by blooming Sakura.
# The light appears
# in your mind's eye,
# the mental image crossing the edge of this world.
# A butterfly,
# springing back to life.
# Subarashiki toki
# Shunkan wo tojikometa eien koso
# Watashitachi no imi soshite igi da to
# Kimi wa shiru darou
# Saa uketoru ga ii
# Eien no sou kono sakura no uta no shita
# This wonderful moment,
# A moment that surely last forever,
# Why are we here, what is our purpose,
# You should already know by now,
# Now, it is time for you accept it,
# The eternal phase, the ending of the poem of Sakura...
# s = '+'+input()
# mode = 1
# sum = 0
# for i in range(0, len(s)):
# if s[i] not in ['+', '-'] and not s[i-1].isdigit():
# num = ''
# for j in range(i, len(s)):
# if s[j].isdigit():
# num += s[j]
# else:
# break
# if num != '':
# sum += mode*int(num)
# elif s[i] == '+':
# mode = 1
# elif s[i] == '-':
# mode = -1
# print(sum)
s = input()
if s[0] != '-':
s = '+' + s
ls = s.replace('+', ',+').replace('-', ',-').split(',')
ans = 0
for x in ls[1:]:
if x[0] == '+':
ans += int(x[1:])
else:
ans -= int(x[1:])
print(ans)
|
# 1641260, 2022-09-24 10:18:50, ----- (0%)
x = '-1-2-3-4-5'
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(x[-1])
if num[0] == '':
num.remove(num[0])
print(num)
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
| # 1641274, 2022-09-24 10:19:03, ----- (0%)
x = input()
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(x[-1])
if num[0] == '':
num.remove(num[0])
print(num)
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
| # 1641292, 2022-09-24 10:19:21, ----- (0%)
x = input()
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(x[-1])
if num[0] == '':
num.remove(num[0])
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
| # 1641368, 2022-09-24 10:20:52, ----- (0%)
x = input()
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(x[-1])
if num[0] == '':
num.remove(num[0])
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
| # 1641645, 2022-09-24 10:26:19, PPPPP (100%)
x = input()
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(s)
if num[0] == '':
num.remove(num[0])
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
| # 1641656, 2022-09-24 10:26:24, PPPPP (100%)
x = input()
num = []
sym = []
s = ''
for i in x:
if i == '+' or i == '-':
num.append(s)
s = ''
sym.append(i)
else:
s += i
num.append(s)
if num[0] == '':
num.remove(num[0])
num[0] = sym[0] + num[0]
sym.remove(sym[0])
r = int(num[0])
num.remove(num[0])
for i in range(len(sym)):
if sym[i] == '+':
r += int(num[i])
else:
r -= int(num[i])
print(r)
|
# 1640829, 2022-09-24 10:08:04, PPPP- (80%)
a = input()
d = '+-'
b = ''
c = ''
if a[0] != '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
for i in range(len(bb)):
bb[i] = int(bb[i])
m = bb[0]
for i in range(len(bb)-1):
if c[i] == '+':
m += bb[i+1]
elif c[i] == '-':
m -= bb[i+1]
print(m)
else:
if a[0] == '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
b2 = bb[1:]
for i in range(len(b2)):
b2[i] = int(b2[i])
print
m = -b2[0]
for i in range(len(b2)-1):
if c[i] == '+':
m += b2[i+1]
elif c[i] == '-':
m -= b2[i+1]
print(m)
| # 1640881, 2022-09-24 10:09:16, xxxxx (0%)
a = input.strip()
d = '+-'
b = ''
c = ''
if a[0] != '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
for i in range(len(bb)):
bb[i] = int(bb[i])
m = bb[0]
for i in range(len(bb)-1):
if c[i] == '+':
m += bb[i+1]
elif c[i] == '-':
m -= bb[i+1]
print(m)
else:
if a[0] == '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
b2 = bb[1:]
for i in range(len(b2)):
b2[i] = int(b2[i])
print
m = -b2[0]
for i in range(len(b2)-1):
if c[i] == '+':
m += b2[i+1]
elif c[i] == '-':
m -= b2[i+1]
print(m)
| # 1640890, 2022-09-24 10:09:33, PPPP- (80%)
a = input().strip()
d = '+-'
b = ''
c = ''
if a[0] != '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
for i in range(len(bb)):
bb[i] = int(bb[i])
m = bb[0]
for i in range(len(bb)-1):
if c[i] == '+':
m += bb[i+1]
elif c[i] == '-':
m -= bb[i+1]
print(m)
else:
if a[0] == '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
b2 = bb[1:]
for i in range(len(b2)):
b2[i] = int(b2[i])
print
m = -b2[0]
for i in range(len(b2)-1):
if c[i] == '+':
m += b2[i+1]
elif c[i] == '-':
m -= b2[i+1]
print(m)
| # 1641372, 2022-09-24 10:20:55, PPPP- (80%)
a = input()
d = '+-'
b = ''
c = ''
if a[0] != '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
for i in range(len(bb)):
bb[i] = int(bb[i])
m = bb[0]
for i in range(len(bb)-1):
if c[i] == '+':
m += bb[i+1]
elif c[i] == '-':
m -= bb[i+1]
print(m)
else:
if a[0] == '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
b2 = bb[1:]
d = c[1:]
print(d)
for i in range(len(b2)):
b2[i] = int(b2[i])
m = -b2[0]
for i in range(len(b2)-1):
if c[i] == '+':
m += b2[i+1]
elif c[i] == '-':
m -= b2[i+1]
print(m)
| # 1641434, 2022-09-24 10:22:07, PPPPP (100%)
a = input()
d = '+-'
b = ''
c = ''
if a[0] != '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
for i in range(len(bb)):
bb[i] = int(bb[i])
m = bb[0]
for i in range(len(bb)-1):
if c[i] == '+':
m += bb[i+1]
elif c[i] == '-':
m -= bb[i+1]
print(m)
else:
if a[0] == '-':
for i in range(len(a)):
if a[i] in d:
b += ','
c += a[i]
else:
b += a[i]
bb = b.split(',')
b2 = bb[1:]
d = c[1:]
for i in range(len(b2)):
b2[i] = int(b2[i])
m = -b2[0]
for i in range(len(b2)-1):
if d[i] == '+':
m += b2[i+1]
elif d[i] == '-':
m -= b2[i+1]
print(m)
|
# 1641960, 2022-09-24 10:31:52, Pxxxx (20%)
x = input()
symbol = []
number = []
s = ""
y = x
for i in range(len(x)):
if x[i] == "-":
if i != 0:
symbol.append("-")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
elif x[i] == "+":
if i != 0:
symbol.append("+")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
a = len(s)
b = len(x)
z = x[:(b-a):]
number.append(z)
x = [int(e) for e in number]
d = x[0]
for i in range(len(x)-1):
if symbol[i] == "-":
d -= x[i+1]
elif symbol[i] == "+":
d += x[i+1]
print(d)
| # 1642138, 2022-09-24 10:34:53, x---- (0%)
x = input()
symbol = []
number = []
s = ""
y = x
for i in range(len(x)):
if x[i] == "-":
if i != 0:
symbol.append("-")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
elif x[i] == "+":
if i != 0:
symbol.append("+")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"+"
a = len(s)
b = len(x)
z = x[:-(b-a+1):-1]
number.append(z)
x = [int(e) for e in number]
d = x[0]
for i in range(len(x)-1):
if symbol[i] == "-":
d -= x[i+1]
elif symbol[i] == "+":
d += x[i+1]
print(d)
| # 1642182, 2022-09-24 10:35:32, x---- (0%)
x = input()
symbol = []
number = []
s = ""
y = x
for i in range(len(x)):
if x[i] == "-":
if i != 0:
symbol.append("-")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
elif x[i] == "+":
if i != 0:
symbol.append("+")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"+"
a = len(s)
b = len(x)
z = x[:-(b-a+1):-1]
number.append(z)
x = [int(e) for e in number]
d = x[0]
for i in range(len(x)-1):
if symbol[i] == "-":
d -= x[i+1]
elif symbol[i] == "+":
d += x[i+1]
print(d)
| # 1642238, 2022-09-24 10:36:19, x---- (0%)
x = input()
symbol = []
number = []
s = ""
y = x
for i in range(len(x)):
if x[i] == "-":
if i != 0:
symbol.append("-")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
elif x[i] == "+":
if i != 0:
symbol.append("+")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"+"
a = len(s)
b = len(x)
z = x[:-(b-a+1):-1]
number.append(z)
x = [int(e) for e in number]
d = x[0]
for i in range(len(x)-1):
if symbol[i] == "-":
d -= x[i+1]
elif symbol[i] == "+":
d += x[i+1]
print(d)
| # 1642401, 2022-09-24 10:38:17, PPPPP (100%)
x = input()
symbol = []
number = []
s = ""
y = x
for i in range(len(x)):
if x[i] == "-":
if i != 0:
symbol.append("-")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"-"
elif x[i] == "+":
if i != 0:
symbol.append("+")
a = y[:i-len(s):]
number.append(a)
y = y[i-len(s)+1::]
s += a+"+"
a = len(s)
b = len(x)
z = x[a::]
number.append(z)
x = [int(e) for e in number]
d = x[0]
for i in range(len(x)-1):
if symbol[i] == "-":
d -= x[i+1]
elif symbol[i] == "+":
d += x[i+1]
print(d)
|
# 1640976, 2022-09-24 10:11:52, xPPPx (60%)
n = input().strip()
plus = n.split('+')
for i in range(len(plus)):
minus = [int(e) for e in plus[i].split('-')]
if (plus[i])[0] == '-':
for j in range(len(minus)):
minus[j] = -1*minus[j]
else:
for j in range(1, len(minus)):
minus[j] = -1*minus[j]
plus[i] = sum(minus)
print(sum(plus))
| # 1641348, 2022-09-24 10:20:24, xxxxx (0%)
n = input().strip()
plus = n.split('+')
for i in range(len(plus)):
minus = plus[i].split('-')
if (plus[i])[0] == '-':
minus.remove(0)
for j in range(len(minus)):
minus[j] = -1*int(minus[j])
else:
for j in range(1, len(minus)):
minus[j] = -1*int(minus[j])
plus[i] = sum(minus)
print(sum(plus))
| # 1641383, 2022-09-24 10:21:04, xxxxx (0%)
n = input().strip()
plus = n.split('+')
for i in range(len(plus)):
minus = plus[i].split('-')
if (plus[i])[0] == '-':
minus.remove(0)
for j in range(len(minus)):
minus[j] = -1*int(minus[j])
plus[i] = sum(minus)
else:
for j in range(1, len(minus)):
minus[j] = -1*int(minus[j])
plus[i] = sum(minus)
print(sum(plus))
| # 1641504, 2022-09-24 10:23:44, P---- (20%)
n = input().strip()
plus = n.split('+')
for i in range(len(plus)):
minus = plus[i].split('-')
intminus = []
if (plus[i])[0] == '-':
for j in range(1, len(minus)):
intminus.append(-1*int(minus[j]))
else:
for j in range(1, len(minus)):
intminus.append(-1*int(minus[j]))
plus[i] = sum(intminus)
print(sum(plus))
| # 1641571, 2022-09-24 10:24:51, PPPPP (100%)
n = input().strip()
plus = n.split('+')
for i in range(len(plus)):
minus = plus[i].split('-')
intminus = []
if (plus[i])[0] == '-':
for j in range(1, len(minus)):
intminus.append(-1*int(minus[j]))
else:
intminus.append(int(minus[0]))
for j in range(1, len(minus)):
intminus.append(-1*int(minus[j]))
plus[i] = sum(intminus)
print(sum(plus))
|
# 1640049, 2022-09-24 09:46:43, xxxxx (0%)
s = input().replace("-", ",-").split("+,")
print(sum(int(i) for i in s))
| # 1640062, 2022-09-24 09:47:11, xxxxx (0%)
s = input().replace("-", ",-").split("+,")
print(sum([int(i) for i in s]))
| # 1640199, 2022-09-24 09:50:49, xPPPx (60%)
s = input().replace("+", ",").replace("-", ",-").split(",")
print(sum([int(i) for i in s]))
| # 1640719, 2022-09-24 10:05:24, PPPPP (100%)
s = input().replace("+", ",").replace("-", ",-").split(",")
print(sum([int(i) for i in s if i != ""]))
|
# 1641147, 2022-09-24 10:16:24, ----- (0%)
x = input().strip()
y = ''
for i in range(len(x)):
if x[i] == '+':
pass
elif x[i] == '-':
y += x[i]
else :
y += x[i]+' '
y = y.split()
out = []
for i in range(len(y)):
out.append(int(y[i]))
print(sum(out))
| # 1641531, 2022-09-24 10:24:20, Pxxx- (20%)
x = input().strip()
y = ''
if x[0] == '-':
c = 1
y += '-'
for i in range(1,len(x)):
if x[i] == '+' or x[i] == '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
else :
c = 0
for i in range(len(x)):
if x[i] != '+' and x[i] != '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
for i in range(c+1,len(x)):
if x[i] != '+' and x[i] != '-':
y += x[i]
elif x[i] == '+' or x[i] == '-':
y += ' '+x[i]+' '
y = y.split()
out = [] ; oper = []
n = len(out)+len(oper)
for i in range(len(y)):
if y[i] != '+' and y[i] != '-':
out.append(int(y[i]))
else:
oper.append(y[i])
oout = out[1::]
res = [out[0]]
for i in range(len(oout)):
if oper[i] == '+':
pass
elif oper[i] == '-':
res.append(int(oper[i]+str(oout[i])))
print(sum(res))
| # 1641654, 2022-09-24 10:26:23, P-P-- (40%)
x = input().strip()
y = ''
if x[0] == '-':
c = 1
y += '-'
for i in range(1,len(x)):
if x[i] == '+' or x[i] == '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
else :
c = 0
for i in range(len(x)):
if x[i] == '+' or x[i] == '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
for i in range(c+1,len(x)):
if x[i] != '+' and x[i] != '-':
y += x[i]
elif x[i] == '+' or x[i] == '-':
y += ' '+x[i]+' '
y = y.split()
out = [] ; oper = []
n = len(out)+len(oper)
for i in range(len(y)):
if y[i] != '+' and y[i] != '-':
out.append(int(y[i]))
else:
oper.append(y[i])
oout = out[1::]
res = [out[0]]
for i in range(len(oout)):
if oper[i] == '+':
pass
elif oper[i] == '-':
res.append(int(oper[i]+str(oout[i])))
print(sum(res))
| # 1641690, 2022-09-24 10:27:07, PPPPP (100%)
x = input().strip()
y = ''
if x[0] == '-':
c = 1
y += '-'
for i in range(1,len(x)):
if x[i] == '+' or x[i] == '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
else :
c = 0
for i in range(len(x)):
if x[i] == '+' or x[i] == '-':
y += ' '+x[c]+' '
break
else:
y += x[i]
c += 1
for i in range(c+1,len(x)):
if x[i] != '+' and x[i] != '-':
y += x[i]
elif x[i] == '+' or x[i] == '-':
y += ' '+x[i]+' '
y = y.split()
out = [] ; oper = []
n = len(out)+len(oper)
for i in range(len(y)):
if y[i] != '+' and y[i] != '-':
out.append(int(y[i]))
else:
oper.append(y[i])
oout = out[1::]
res = [out[0]]
for i in range(len(oout)):
if oper[i] == '+':
res.append(oout[i])
elif oper[i] == '-':
res.append(int(oper[i]+str(oout[i])))
print(sum(res))
|
# 1641061, 2022-09-24 10:14:03, xPP-x (40%)
a = input().split('-')
result = []
for i in range(len(a)) :
if '+' in a[i] :
k = [int(e) for e in a[i].split('+')]
result.append(sum(k))
else :
result.append(int(a[i]))
k = result[0]
for i in range(1,len(result)) :
k -= result[i]
print(k)
| # 1641224, 2022-09-24 10:18:03, PPP-- (60%)
a = input().split('-')
result = []
for i in range(len(a)) :
if a[i] == '' :
a[i] = '0'
for i in range(len(a)) :
if '+' in a[i] :
k = [int(e) for e in a[i].split('+')]
result.append(sum(k))
else :
result.append(int(a[i]))
k = result[0]
for i in range(1,len(result)) :
k -= result[i]
print(k)
| # 1642045, 2022-09-24 10:33:32, P-PPP (80%)
a = input().split('-')
result = []
for i in range(len(a)) :
if a[i] == '' :
a[i] = '0'
for i in range(len(a)) :
if '+' in a[i] :
k = [int(e) for e in a[i].split('+')]
k[0] = -k[0]
result.append(-sum(k))
else :
result.append(int(a[i]))
c = result[0]
for i in range(1,len(result)) :
c -= result[i]
print(c)
| # 1642164, 2022-09-24 10:35:20, PPPPP (100%)
a = input().split('-')
result = []
for i in range(len(a)) :
if a[i] == '' :
a[i] = '0'
for i in range(len(a)) :
if len(a) == 1 :
k = [int(e) for e in a[i].split('+')]
result.append(sum(k))
else :
if '+' in a[i] :
k = [int(e) for e in a[i].split('+')]
k[0] = -k[0]
result.append(-sum(k))
else :
result.append(int(a[i]))
c = result[0]
for i in range(1,len(result)) :
c -= result[i]
print(c)
|
# 1640681, 2022-09-24 10:04:16, PPxxx (40%)
x = input()
x+='+'
l = []
r = 0
# if '+' or '-' not in x:
# x='+'+x
k = ''
for i in range(len(x)):
if x[i] =='+':
l.append('+')
l.append(int(k))
k=''
else:
k+=x[i]
s = l[1]
for i in range(0,len(l)-2,2):
if l[i] =='+':
s += l[i+3]
print(s)
| # 1640709, 2022-09-24 10:05:10, PPxxx (40%)
x = input()
x+='+'
l = []
r = 0
# if '+' or '-' not in x:
# x='+'+x
k = ''
for i in range(len(x)):
if x[i] =='+':
l.append('+')
l.append(int(k))
k=''
else:
k+=x[i]
s = l[1]
for i in range(0,len(l)-2,2):
if l[i] =='+':
s += l[i+3]
elif l[i] =='-':
s-= l[i+3]
print(s)
| # 1640861, 2022-09-24 10:08:51, xPPPx (60%)
x = input()
x+='+'
l = []
r = 0
# if '+' or '-' not in x:
# x='+'+x
k = ''
for i in range(len(x)):
if x[i] =='+':
l.append('+')
l.append(int(k))
k=''
elif x[i] =='-':
l.append('-')
l.append(int(k))
k=''
else:
k+=x[i]
s = l[1]
for i in range(0,len(l)-2,2):
if l[i] =='+':
s += l[i+3]
elif l[i] =='-':
s-= l[i+3]
print(s)
| # 1640933, 2022-09-24 10:10:44, PPPPP (100%)
x = input()
x+='+'
l = []
r = 0
if x[0] == '-':
x='0'+x
k = ''
for i in range(len(x)):
if x[i] =='+':
l.append('+')
l.append(int(k))
k=''
elif x[i] =='-':
l.append('-')
l.append(int(k))
k=''
else:
k+=x[i]
s = l[1]
for i in range(0,len(l)-2,2):
if l[i] =='+':
s += l[i+3]
elif l[i] =='-':
s-= l[i+3]
print(s)
|
# 1641391, 2022-09-24 10:21:15, ----- (0%) String = input() #String = "1+2-3+4-5" #String = "20" #String = "-13" #String = "1+2+3+4+5" #String = "-1-2-3-4-5" #String = "9999-999+99-9" #String = "10-9+8-7+6-5+4-3+2-1" | # 1641459, 2022-09-24 10:22:41, compilation error (0%)
String = input()
#String = "1+2-3+4-5"
#String = "20"
#String = "-13"
#String = "1+2+3+4+5"
#String = "-1-2-3-4-5"
#String = "9999-999+99-9"
#String = "10-9+8-7+6-5+4-3+2-1"
if String[0] == "-";
String = "0" + String
#print(String)
A = String.split("-")
#print(A)
| # 1641505, 2022-09-24 10:23:48, compilation error (0%)
String = input()
#String = "1+2-3+4-5"
#String = "20"
#String = "-13"
#String = "1+2+3+4+5"
#String = "-1-2-3-4-5"
#String = "9999-999+99-9"
#String = "10-9+8-7+6-5+4-3+2-1"
if String[0] == "-";
String = "0" + String
#print(String)
A = String.split("-")
#print(A)
X = []
for i in A:
if i == A[-1]:
X.append(i)
else:
X.append(i)
X.append("-")
#print(X)
| # 1641842, 2022-09-24 10:29:52, PPPPP (100%)
String = input()
#String = "1+2-3+4-5"
#String = "20"
#String = "-13"
#String = "1+2+3+4+5"
#String = "-1-2-3-4-5"
#String = "9999-999+99-9"
#String = "10-9+8-7+6-5+4-3+2-1"
if String[0] == "-":
String = "0" + String
#print(String)
A = String.split("-")
#print(A)
X = []
for i in A:
if i == A[-1]:
X.append(i)
else:
X.append(i)
X.append("-")
#print(X)
Y = []
for i in X:
if "+" in i:
Temp = i.split("+")
for j in Temp:
if j == Temp[-1]:
Y.append(j)
else:
Y.append(j)
Y.append("+")
else:
Y.append(i)
#print(Y)
Result = int(Y[0])
for i in range(1, len(Y), 2):
if i != len(Y) - 1:
if Y[i] == "+":
Result = Result + int(Y[i+1])
elif Y[i] == "-":
Result = Result - int(Y[i+1])
print(Result)
|
# 1639801, 2022-09-24 09:39:45, xPPPx (60%)
equation = input()
num = ""
num_list = []
sign_list = []
sum = 0
for i in range(len(equation)+1):
if i == len(equation):
num_list.append(num)
elif equation[i] not in "+-":
num += equation[i]
elif equation[i] in "+-":
num_list.append(num)
sign_list += equation[i]
num = ""
sum += int(num_list[0])
for i in range(len(sign_list)):
if sign_list[i] == "+":
sum += int(num_list[i+1])
if sign_list[i] == "-":
sum -= int(num_list[i+1])
print(sum)
| # 1639873, 2022-09-24 09:41:37, xP--x (20%)
equation = input()
num = ""
num_list = []
sign_list = []
sum = 0
for i in range(len(equation)+1):
if i == len(equation):
num_list.append(num)
elif equation[i] not in "+-":
num += equation[i]
elif equation[i] in "+-":
num_list.append(num)
sign_list += equation[i]
num = ""
if sign_list[0] == "-":
sum -= int(num_list[0])
else:
sum += int(num_list[0])
for i in range(len(sign_list)):
if sign_list[i] == "+":
sum += int(num_list[i+1])
if sign_list[i] == "-":
sum -= int(num_list[i+1])
print(sum)
| # 1640076, 2022-09-24 09:47:36, P---- (20%)
equation = input()
num = ""
num_list = []
sign_list = []
sum = 0
for i in range(len(equation)+1):
if i == len(equation):
num_list.append(num)
elif equation[i] not in "+-":
num += equation[i]
elif equation[i] in "+-":
num_list.append(num)
sign_list += equation[i]
num = ""
if sign_list[0] == "-":
sum -= int(num_list[1])
else:
sum += int(num_list[1])
for i in range(1,len(sign_list)):
if sign_list[i-1] == "+":
sum += int(num_list[i+1])
if sign_list[i-1] == "-":
sum -= int(num_list[i+1])
print(sum)
| # 1640483, 2022-09-24 09:59:01, PPPPP (100%)
equation = input()
num = ""
num_list = []
sign_list = []
sum = 0
for i in range(len(equation)+1):
if i == len(equation):
num_list.append(num)
elif equation[i] not in "+-":
num += equation[i]
elif equation[i] in "+-":
num_list.append(num)
sign_list += equation[i]
num = ""
if "" in num_list:
num_list.remove("")
if len(num_list) != 1:
if len(sign_list) == len(num_list):
for i in range(len(sign_list)):
if sign_list[i] == "+":
sum += int(num_list[i])
if sign_list[i] == "-":
sum -= int(num_list[i])
elif len(sign_list) != len(num_list):
sum += int(num_list[0])
for i in range(len(sign_list)):
if sign_list[i] == "+":
sum += int(num_list[i+1])
if sign_list[i] == "-":
sum -= int(num_list[i+1])
else:
if sign_list == []:
sum += int(num_list[0])
elif sign_list[0] == "-":
sum -= int(num_list[0])
else:
sum += int(num_list[0])
print(sum)
|
# 1640596, 2022-09-24 10:02:05, ----- (0%)
num = list(input())
op = '+-'
numsum = ''
opsum = ''
numlist = []
sum = 0
for i in range (len(num)-1) :
if num[i] in op :
opsum += num[i]
numlist += numsum
numsum = ''
else :
numsum += num[i]
numlist += numsum
print(numsum)
print(numlist)
print(opsum)
for a in range (len(opsum)) :
if opsum[a] == '-':
numlist[a+1] = '-'+numlist[a+1]
for s in range (len(numlist)) :
sum += int(numlist[s])
print(sum)
| # 1641493, 2022-09-24 10:23:36, xPPPx (60%)
num = list(input())
op = '+-'
numsum = ''
opsum = ''
numlist = []
sum = 0
for i in range (len(num)) :
if num[i] in op :
opsum += num[i]
numlist.append(str(numsum))
numsum = ''
else :
numsum += str(num[i])
numlist.append(str(numsum))
for a in range (len(opsum)) :
if opsum[a] == '-':
numlist[a+1] = '-'+numlist[a+1]
if len(numlist) == 1:
print(numlist[0])
else :
for s in range (len(numlist)) :
sum += int(numlist[s])
print(sum)
| # 1641850, 2022-09-24 10:29:57, PPPPP (100%)
num = list(input())
op = '+-'
numsum = ''
opsum = ''
numlist = []
sum = 0
for i in range (len(num)) :
if num[i] in op :
opsum += num[i]
numlist.append(str(numsum))
numsum = ''
else :
numsum += str(num[i])
if numsum != "" :
numlist.append(str(numsum))
for a in range (len(opsum)) :
if opsum[a] == '-':
numlist[a+1] = '-'+numlist[a+1]
if len(numlist) == 1:
print(numlist[0])
else :
for s in range (len(numlist)) :
if numlist[s] != '':
sum += int(numlist[s])
print(sum)
| # 1642005, 2022-09-24 10:32:51, PPPPP (100%)
num = list(input())
op = '+-'
numsum = ''
opsum = ''
numlist = []
sum = 0
for i in range (len(num)) :
if num[i] in op :
opsum += num[i]
numlist.append(str(numsum))
numsum = ''
else :
numsum += str(num[i])
numlist.append(str(numsum))
for a in range (len(opsum)) :
if opsum[a] == '-':
numlist[a+1] = '-'+numlist[a+1]
if len(numlist) == 1:
print(numlist[0])
else :
for s in range (len(numlist)) :
if numlist[s] != '':
sum += int(numlist[s])
print(sum)
|
# 1639880, 2022-09-24 09:41:45, xPPPx (60%)
text = str(input())
text = text.replace("+",",")
text = text.replace("-",",-")
text.strip()
numberlist = text.split(",")
total = 0
for e in numberlist:
total += int(e)
print(total)
| # 1640078, 2022-09-24 09:47:38, ----- (0%)
text = "0" + str(input())
text.strip()
text = text.replace("+",",")
text = text.replace("-",",-")
numberlist = text.split(",")
print(numberlist)
total = 0
for e in numberlist:
total += int(e)
print(total)
| # 1640088, 2022-09-24 09:47:48, PPPPP (100%)
text = "0" + str(input())
text.strip()
text = text.replace("+",",")
text = text.replace("-",",-")
numberlist = text.split(",")
total = 0
for e in numberlist:
total += int(e)
print(total)
| # 1640229, 2022-09-24 09:51:33, PPPPP (100%)
text = "0" + str(input())
text.strip()
text = text.replace("+",",")
text = text.replace("-",",-")
numberlist = text.split(",")
total = 0
for e in numberlist:
total += int(e)
print(total)
|
# 1639776, 2022-09-24 09:39:06, -xxxx (0%)
#AUTHOR : CHANATIP PATTANAPEN 6532040021
s = input()
sn = s.replace('-', ' ')
sn = sn.replace('+', ' ')
lst = [int(i) for i in sn.split()]
ind = 1
if(s[0] == '-'): lst[0] = -lst[0]
ans = s[0]
if(len(lst) > 1):
for i in s:
if (i == '-'):
ans -= lst[ind]
if (i == '+'):
ans += lst[ind]
ind += 1
print(ans)
| # 1639799, 2022-09-24 09:39:37, Pxxxx (20%)
#AUTHOR : CHANATIP PATTANAPEN 6532040021
s = input()
sn = s.replace('-', ' ')
sn = sn.replace('+', ' ')
lst = [int(i) for i in sn.split()]
ind = 1
if(s[0] == '-'): lst[0] = -lst[0]
ans = lst[0]
if(len(lst) > 1):
for i in s:
if (i == '-'):
ans -= lst[ind]
if (i == '+'):
ans += lst[ind]
ind += 1
print(ans)
| # 1639832, 2022-09-24 09:40:41, PPPPx (80%)
#AUTHOR : CHANATIP PATTANAPEN 6532040021
s = input()
sn = s.replace('-', ' ')
sn = sn.replace('+', ' ')
lst = [int(i) for i in sn.split()]
ind = 1
if(s[0] == '-'): lst[0] = -lst[0]
ans = lst[0]
if(len(lst) > 1):
for i in s:
if (i == '-'):
ans -= lst[ind]
ind += 1
if (i == '+'):
ans += lst[ind]
ind += 1
print(ans)
| # 1639930, 2022-09-24 09:43:23, PPPPP (100%)
#AUTHOR : CHANATIP PATTANAPEN 6532040021
s = input()
sn = s.replace('-', ' ')
sn = sn.replace('+', ' ')
lst = [int(i) for i in sn.split()]
ind = 1
if(s[0] == '-'): lst[0] = -lst[0]
ans = lst[0]
if(len(lst) > 1):
for i in range(1, len(s)):
if (s[i] == '-'):
ans -= lst[ind]
ind += 1
if (s[i] == '+'):
ans += lst[ind]
ind += 1
print(ans)
|
# 1641783, 2022-09-24 10:28:55, ----- (0%)
a=str(input())
symbol=[]
place=[]
data=[]
for i in range(len(a)):
if i!=0:
if a[i]=="+" or a[i]=="-":
symbol.append(a[i])
place.append(i)
print(symbol)
print(place)
if len(place)>0:
for j in range(len(place)):
if j==0:
data.append(a[:place[0]])
elif j>0 and j<(len(place)):
data.append(a[place[j-1]+1:place[j]])
if j+1==(len(place)):
data.append(a[place[j]+1::])
else:
data.append(a)
| # 1641808, 2022-09-24 10:29:19, ----- (0%)
a=str(input())
symbol=[]
place=[]
data=[]
for i in range(len(a)):
if i!=0:
if a[i]=="+" or a[i]=="-":
symbol.append(a[i])
place.append(i)
if len(place)>0:
for j in range(len(place)):
if j==0:
data.append(a[:place[0]])
elif j>0 and j<(len(place)):
data.append(a[place[j-1]+1:place[j]])
if j+1==(len(place)):
data.append(a[place[j]+1::])
else:
data.append(a)
| # 1642147, 2022-09-24 10:35:05, PPPPP (100%)
a=str(input())
symbol=[]
place=[]
data=[]
for i in range(len(a)):
if i!=0:
if a[i]=="+" or a[i]=="-":
symbol.append(a[i])
place.append(i)
if len(place)>0:
for j in range(len(place)):
if j==0:
data.append(a[:place[0]])
elif j>0 and j<(len(place)):
data.append(a[place[j-1]+1:place[j]])
if j+1==(len(place)):
data.append(a[place[j]+1::])
else:
data.append(a)
sum=int(data[0])
for k in range (len(symbol)):
if symbol[k]=="+":
sum+=int(data[k+1])
if symbol[k]=='-':
sum-=int(data[k+1])
print(sum)
|
# 1640186, 2022-09-24 09:50:34, Pxxxx (20%)
x = input()
sum = 0
if "+" or '=' not in x[1::]:
print( int(x))
else:
pass
| # 1641520, 2022-09-24 10:24:05, ----- (0%)
x = input()
x_without_sign = ' '
#x1_without_sign = ' '
x_without_sign= x.replace('-',' -')
x_without_sign = x_without_sign.replace('+',' ')
t =x_without_sign.split()
print(t)
sum =0
for ele in t:
sum += int(ele)
print(sum)
| # 1641565, 2022-09-24 10:24:46, PPPPP (100%)
x = input()
x_without_sign = ' '
#x1_without_sign = ' '
x_without_sign= x.replace('-',' -')
x_without_sign = x_without_sign.replace('+',' ')
t =x_without_sign.split()
#print(t)
sum =0
for ele in t:
sum += int(ele)
print(sum)
|
# 1640245, 2022-09-24 09:52:03, -PPP- (60%)
a = input().strip()
m = [[]]
result = 0
p = 0
for i in a :
if p == 0 and a[0] == "-" :
m.append(["-"+i])
p+=1
elif i not in "+-" and (m[-1] != ["+"] or m[-1] != ["-"] ):
m[-1].append(i)
else :
m.append([i])
if m[1][0] == "--" :
m[1] = ["-"+m[1][1]]
m = m[1::]
for i in m :
if i[0] == "+" :
result += int(("").join(i[1:]))
elif i[0] == "-" :
result -= int(("").join(i[1:]))
else :
result += int(("").join(i))
print(result)
| # 1640328, 2022-09-24 09:54:31, -PPP- (60%)
a = input().strip()
m = [[]]
result = 0
p = 0
for i in a :
if p == 0 and a[0] == "-" :
m.append(["-"+i])
p+=1
elif i not in "+-" and (m[-1] != ["+"] or m[-1] != ["-"] ):
m[-1].append(i)
else :
m.append([i])
if p==1 and m[1][0] == "--" :
m[1] = ["-"+m[1][1]]
m = m[1::]
for i in m :
if i[0] == "+" :
result += int(("").join(i[1:]))
elif i[0] == "-" :
result -= int(("").join(i[1:]))
else :
result += int(("").join(i))
print(result)
| # 1640387, 2022-09-24 09:56:22, PPPPP (100%)
a = input().strip()
m = [[]]
result = 0
p = 0
for i in a :
if p == 0 and a[0] == "-" :
m.append(["-"+i])
p+=1
elif i not in "+-" and (m[-1] != ["+"] or m[-1] != ["-"] ):
m[-1].append(i)
else :
m.append([i])
if p==1 and m[1][0] == "--" :
m[1] = ["-"]+m[1][1:]
m = m[1::]
for i in m :
if i[0] == "+" :
result += int(("").join(i[1:]))
elif i[0] == "-" :
result -= int(("").join(i[1:]))
else :
result += int(("").join(i))
print(result)
|
# 1641283, 2022-09-24 10:19:13, x---x (0%)
c = input()
op = ['+' , '-']
if c[0] == '-':
c__new = c[1:]
else:
c_new = c
c_new += '+'
ls = []
k = ''
for i in range(len(c_new)):
if c_new[i] not in op:
k += c_new[i]
else:
ls.append(int(k))
ls.append(c_new[i])
k = ''
ls += [0]
s= ls[0]
for i in range(1,len(ls)-1,2):
if ls[i] == '+':
s+=ls[i+1]
if ls[i] == '-':
s-=ls[i+1]
print(s)
if c[0] == '-':
s = s - (2*ls[0])
print(s)
| # 1641305, 2022-09-24 10:19:37, xPPPx (60%)
c = input()
op = ['+' , '-']
if c[0] == '-':
c__new = c[1:]
else:
c_new = c
c_new += '+'
ls = []
k = ''
for i in range(len(c_new)):
if c_new[i] not in op:
k += c_new[i]
else:
ls.append(int(k))
ls.append(c_new[i])
k = ''
ls += [0]
s= ls[0]
for i in range(1,len(ls)-1,2):
if ls[i] == '+':
s+=ls[i+1]
if ls[i] == '-':
s-=ls[i+1]
if c[0] == '-':
s = s - (2*ls[0])
print(s)
| # 1642247, 2022-09-24 10:36:26, PPPPP (100%)
c = input()
op = ['+' , '-']
if c[0] == '-':
c_new = c[1:]
else:
c_new = c
c_new += '+'
ls = []
k = ''
for i in range(len(c_new)):
if c_new[i] not in op:
k += c_new[i]
else:
ls.append(int(k))
ls.append(c_new[i])
k = ''
ls += [0]
s= ls[0]
for i in range(1,len(ls)-1,2):
if ls[i] == '+':
s+=ls[i+1]
if ls[i] == '-':
s-=ls[i+1]
if c[0] == '-':
s = s - (2*ls[0])
print(s)
|
# 1641328, 2022-09-24 10:20:00, xPPPx (60%)
x= input()
sums = 0
each =""
for i in range(len(x)):
if x[i] in "1234567890":
each += x[i]
else:
if x[i] == "-":
sums += int(each)+0
each = x[i]
else:
sums += int(each)
each = ""
if each != "":
sums += int(each)
print(sums)
| # 1641848, 2022-09-24 10:29:55, PPPPx (80%)
x= input()
sums = 0
each =""
if x[0] == "-" and x.count("-") == 1:
print(x)
else:
for i in range(len(x)):
if x[i] in "1234567890":
each += x[i]
else:
if x[i] == "-":
sums += int(each)
each = x[i]
else:
sums += int(each)
each = ""
if each != "":
sums += int(each)
print(sums)
| # 1642124, 2022-09-24 10:34:42, PPPPP (100%)
x= input()
sums = 0
each =""
if x[0] == "-" and x.count("-") == 1:
print(x)
else:
for i in range(len(x)):
if x[i] in "1234567890":
each += x[i]
else:
if x[i] == "-":
if each == "":
pass
else:
sums += int(each)
each = x[i]
else:
sums += int(each)
each = ""
if each != "":
sums += int(each)
print(sums)
|
# 1640605, 2022-09-24 10:02:17, PPPPP (100%)
n = input()
z="0123456789"
op = []
num = []
re = 0
g = 0
n+= " "
for i in range(0,len(n)):
if n[i] not in z and i > 0 :
op.append(n[i])
num.append(n[re:i])
re = i+1
num = [int(i) for i in num ]
ans = num[0]
for i in range(0,len(op)-1):
if op[i] == "+":
ans += num[i+1]
elif op[i] == "-":
ans -= num[i+1]
if num == [] :
print(n)
print(ans)
| # 1640821, 2022-09-24 10:07:55, PPPPP (100%)
n = input()
z="0123456789"
op = []
num = []
re = 0
g = 0
n+= " "
for i in range(0,len(n)):
if n[i] not in z and i > 0 :
op.append(n[i])
num.append(n[re:i])
re = i+1
num = [int(i) for i in num ]
ans = num[0]
for i in range(0,len(op)-1):
if op[i] == "+":
ans += num[i+1]
elif op[i] == "-":
ans -= num[i+1]
if num == [] :
print(n)
print(ans)
| # 1641181, 2022-09-24 10:17:12, PPPPP (100%)
n = input()
z="0123456789"
op = []
num = []
re = 0
g = 0
n+= " "
for i in range(0,len(n)):
if n[i] not in z and i > 0 :
op.append(n[i])
num.append(n[re:i])
re = i+1
num = [int(i) for i in num ]
ans = num[0]
for i in range(0,len(op)-1):
if op[i] == "+":
ans += num[i+1]
elif op[i] == "-":
ans -= num[i+1]
if num == [] :
print(n)
print(ans)
|
# 1638662, 2022-09-24 09:13:32, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else:
if c % 2 == 0:
d += a
else :
if d > c:
c += d
else:
b += a
a = b + c
print(a,b,c,d)
| # 1638915, 2022-09-24 09:17:56, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b :
a,b = b,a
while d >= a :
if c > d :
a += 1
else :
d -= 1
else:
if c % 2 == 0:
d += a
else :
if d > c:
c += d
else:
b += a
a = b + c
print(a,b,c,d)
| # 1640034, 2022-09-24 09:46:24, PPPPP (100%)
x = input()
val = ['']
c = 0
for i in x :
if i <= '9' and i >= '0':
val[c] += i
elif i in ['+','-']:
c += 1
val.append(i)
if '' in val : val.remove('')
t = 0
for i in val:
t += int(i)
print(t)
|
# 1640742, 2022-09-24 10:05:59, P---P (40%)
a = input()
C = ' '
sym = []
result=[]
count = 0
for i in a:
if i not in ('+-'):
C = C+i
if i in '+-':
C = C+ ' '
c = C.split()
for i in a:
if i in '-':
result.append(-int(c[count]))
count = count+1
elif i in '+':
result.append(int(c[count]))
count = count+1
elif i == c[-1] and len(result) != len(c):
result.append(int(c[count]))
result = [int(i) for i in result]
S = sum(result)
print(S)
| # 1641007, 2022-09-24 10:12:48, PPPPP (100%)
a = input()
C = ' '
sym = []
result=[]
count = 0
if a[0] != '-':
a = '+'+a
for i in a:
if i not in ('+-'):
C = C+i
if i in '+-':
C = C+ ' '
c = C.split()
for i in a:
if i in '-':
result.append(-int(c[count]))
count = count+1
elif i in '+':
result.append(int(c[count]))
count = count+1
#elif i == c[-1] and len(result) != len(c):
#result.append(int(c[count]))
result = [int(i) for i in result]
S = sum(result)
print(S)
| # 1641157, 2022-09-24 10:16:41, PPPPP (100%)
a = input()
C = ' '
sym = []
result=[]
count = 0
if a[0] != '-':
a = '+'+a
for i in a:
if i not in ('+-'):
C = C+i
if i in '+-':
C = C+ ' '
c = C.split()
for i in a:
if i in '-':
result.append(-int(c[count]))
count = count+1
elif i in '+':
result.append(int(c[count]))
count = count+1
result = [int(i) for i in result]
S = sum(result)
print(S)
|
# 1639709, 2022-09-24 09:37:22, ----- (0%)
x = input()
d = []
for i in range(0,len(x)-1):
if '0'<=x[i]<='9':
d+=[x[i]]
if x[i] in ['-']:
d+=[]
d+=[x[i]+x[i+1]]
if x[i] in ['+']:
d+=[]
d+=x[i+1]
d = [int(e) for e in d]
ans = sum(d)
print(ans)
| # 1639967, 2022-09-24 09:44:15, ----- (0%)
x = input()
d = []
for i in range(0,len(x)):
if '0'<=x[i]<='9':
d+=[x[i]]
if x[i] in ['-']:
d+=[]
d+=['-'+x[i+1]]
if x[i] in ['+']:
d+=[]
d = [int(e) for e in d]
d = sum(d)
print(d)
| # 1642457, 2022-09-24 10:38:56, PPPPP (100%)
x = input()
d = []
a=''
n=0
t = 0
for i in range(0,len(x)):
if '0'<=x[i]<='9':
d+=[x[i]]
if x[i] in ['-']:
d+=[]
d+=['-']
if x[i] in ['+']:
d+=[]
d+=['+']
for i in d:
if '0' <= i <= '9':
a+=str(i)
if i == '-':
a+=' '
a+='-'
if i == '+':
a+=' '
a+='+'
a= a.split()
a = [int(e) for e in a]
a = sum(a)
print(a)
|
# 1639419, 2022-09-24 09:30:00, x---x (0%)
command = input()
new = ''
for i in command:
if i == '-':
new += '+-'
else:
new += i
print(new)
list_com = [int(e) for e in new.split('+')]
print(sum(list_com))
| # 1639440, 2022-09-24 09:30:27, xPPPx (60%)
command = input()
new = ''
for i in command:
if i == '-':
new += '+-'
else:
new += i
list_com = [int(e) for e in new.split('+')]
print(sum(list_com))
| # 1639775, 2022-09-24 09:39:05, PPPPP (100%)
command = input()
new = ''
if '+' in command or command.count('-') > 2:
for i in command:
if i == '-':
new += '+-'
else:
new += i
list_com = [int(e) for e in new.strip('+').split('+')]
else:
list_com = [int(command), 0]
print(sum(list_com))
|
# 1640208, 2022-09-24 09:51:09, PP--- (40%)
# 2565_1_Quiz_1_3.py
s = input()
last = 0
ans = 0
for i in range(1,len(s)):
if s[i] == '+':
ans += int(s[last:i])
last = i+1
elif s[i] == '-':
ans -= int(s[last:i])
last = i+1
ans+= int(s[last:])
print(ans)
| # 1640538, 2022-09-24 10:00:16, PPPPP (100%)
# 2565_1_Quiz_1_3.py
def isNum(s):
return s in ['0','1','2','3','4','5','6','7','8','9']
s = input()
if s[0] != '-':
s = '+' + s
last = 0
ans = 0
for i in range(0,len(s)):
if s[i] == '+':
num = ''
for j in s[i+1:]:
if isNum(j):
num += j
else:
break
ans += int(num)
elif s[i] == '-':
num = ''
for j in s[i+1:]:
if isNum(j):
num += j
else:
break
ans -= int(num)
print(ans)
| # 1641886, 2022-09-24 10:30:29, PPPPP (100%)
# 2565_1_Quiz_1_3.py
s = input()
if s[0] != '-':
s = '+' + s
ans = 0
op = []
for i in range(0,len(s)):
if s[i] == '+' or s[i] == '-':
op.append(i)
for i in range(len(op)-1):
if s[op[i]] == '+':
ans += int(s[op[i]+1:op[i+1]])
if s[op[i]] == '-':
ans -= int(s[op[i]+1:op[i+1]])
if s[op[-1]] == '+':
ans += int(s[op[-1]+1:])
if s[op[-1]] == '-':
ans -= int(s[op[-1]+1:])
print(ans)
|
# 1640458, 2022-09-24 09:58:32, xPPPx (60%)
x=input()
x=x.split('+')
for i in range(len(x)):
x[i]=x[i].split('-')
y=int(x[i][0])
for j in range(len(x[i])-1):
y += -int(x[i][j+1])
x[i]=y
print(sum(x))
| # 1640690, 2022-09-24 10:04:33, ----- (0%)
x=input()
x=x.split('+')
for i in range(len(x)):
x[i]=x[i].split('-')
if x[i][0]=='':
y=0
else:
y=int(x[i][0])
print(x)
for j in range(len(x[i])-1):
y += -int(x[i][j+1])
x[i]=y
print(sum(x))
| # 1640693, 2022-09-24 10:04:43, PPPPP (100%)
x=input()
x=x.split('+')
for i in range(len(x)):
x[i]=x[i].split('-')
if x[i][0]=='':
y=0
else:
y=int(x[i][0])
for j in range(len(x[i])-1):
y += -int(x[i][j+1])
x[i]=y
print(sum(x))
|
# 1640152, 2022-09-24 09:49:35, x---- (0%)
n = input()
num = []
i = 0
while i<len(n) :
x = ""
if (n[0] != "+" or n[0] != "-") and i == 0 :
while True :
x += n[i]
i += 1
if n[i] == "+" or n[i] == "-":
num.append(x)
x = ""
break
if n[i] == "+" or n[i] == "-" :
while i<len(n) :
if (n[i] == "+" or n[i] == "-") and x!= "" :
break
x+= n[i]
i += 1
num.append(x)
for i in range(len(num)) :
if i < 0 :
num[i] = int(num[i])
else :
num[i] = -int(num[i][0:])
print(sum(num))
| # 1640171, 2022-09-24 09:50:22, xPPPP (80%)
n = input()
num = []
i = 0
while i<len(n) :
x = ""
if (n[0] != "+" or n[0] != "-") and i == 0 :
while True :
x += n[i]
i += 1
if n[i] == "+" or n[i] == "-":
num.append(x)
x = ""
break
if n[i] == "+" or n[i] == "-" :
while i<len(n) :
if (n[i] == "+" or n[i] == "-") and x!= "" :
break
x+= n[i]
i += 1
num.append(x)
for i in range(len(num)) :
if i < 0 :
num[i] = -int(num[i])
else :
num[i] = int(num[i][0:])
print(sum(num))
| # 1640329, 2022-09-24 09:54:32, PPPPP (100%)
n = input()
num = []
i = 0
while i<len(n) :
x = ""
if (n[0] != "+" or n[0] != "-") and i == 0 :
while True :
x += n[i]
i += 1
if i>=len(n):
num.append(x)
break
if n[i] == "+" or n[i] == "-":
num.append(x)
x = ""
break
if i>=len(n):break
if n[i] == "+" or n[i] == "-" :
while i<len(n) :
if (n[i] == "+" or n[i] == "-") and x!= "" :
break
x+= n[i]
i += 1
num.append(x)
for i in range(len(num)) :
if i < 0 :
num[i] = -int(num[i])
else :
num[i] = int(num[i][0:])
print(sum(num))
|
# 1639543, 2022-09-24 09:32:59, ----- (0%)
s = input()
x = 0
current = '0'
todo = '+'
for i in range(len(s)):
if s[i] == '+' or s[i] == '-':
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
todo = s[i]
current = '0'
elif i == len(s) - 1:
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
else:
current += s[i]
print(x)
| # 1639685, 2022-09-24 09:36:38, ----- (0%)
s = input()
x = 0
current = '0'
todo = '+'
for i in range(len(s)):
if i == len(s) - 1:
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
if s[i] == '+' or s[i] == '-':
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
todo = s[i]
current = '0'
else:
current += s[i]
print(x)
| # 1639744, 2022-09-24 09:38:21, PPPPP (100%)
s = input() + ' '
x = 0
current = '0'
todo = '+'
for i in range(len(s)):
if i == len(s) - 1:
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
if s[i] == '+' or s[i] == '-':
if todo == '+':
x += int(current)
elif todo == '-':
x -= int(current)
todo = s[i]
current = '0'
else:
current += s[i]
print(x)
|
# 1638795, 2022-09-24 09:15:08, PPPPP (100%) n = input() print(eval(n)) | # 1639666, 2022-09-24 09:36:03, xPPPx (60%)
n = input()
lst = []
no = ""
for i in n:
no += i
if i == "+":
lst.append(int(no[:len(no)-1]))
no = ""
elif i == "-":
lst.append(int(no[:len(no)-1]))
no = "-"
lst.append(int(no))
print(sum(lst))
| # 1639738, 2022-09-24 09:38:13, PPPPP (100%)
n = input()
lst = []
no = ""
c = 0
for i in n:
no += i
if i == "+":
lst.append(int(no[:len(no)-1]))
no = ""
elif i == "-" and c != 0:
lst.append(int(no[:len(no)-1]))
no = "-"
c += 1
lst.append(int(no))
print(sum(lst))
|
# 1640643, 2022-09-24 10:03:21, xPPPx (60%)
x = input().strip()
x = list(x)
num = ""
num_list = []
for e in x+["dummy"] :
if "0" <= e <= "9" :
num += e
else :
num_list.append(int(num))
num = ""
operator_list = []
for e in x :
if e == "+" or e == "-" :
operator_list.append(e)
if len(num_list) > len(operator_list) : #ตัวเเรกเป็น +
ans = num_list[0]
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i+1]
elif operator_list[i] == "-" :
ans -= num_list[i+1]
print(ans)
else : #ตัวเเรกเป็นลบ
ans = 0
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i]
elif operator_list[i] == "-" :
ans -= num_list[i]
print(ans)
| # 1640875, 2022-09-24 10:09:05, PPPPP (100%)
x = input().strip()
x1 = list(x)
if x1[0] == "-" :
x1 = x1[1::]
x2 = list(x)
num = ""
num_list = []
for e in x1+["dummy"] :
if "0" <= e <= "9" :
num += e
else :
num_list.append(int(num))
num = ""
operator_list = []
for e in x2 :
if e == "+" or e == "-" :
operator_list.append(e)
if len(num_list) > len(operator_list) : #ตัวเเรกเป็น +
ans = num_list[0]
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i+1]
elif operator_list[i] == "-" :
ans -= num_list[i+1]
print(ans)
else : #ตัวเเรกเป็นลบ
ans = 0
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i]
elif operator_list[i] == "-" :
ans -= num_list[i]
print(ans)
| # 1640944, 2022-09-24 10:10:58, PPPPP (100%)
x = input().strip()
x1 = list(x) #x1 for numbers
if x1[0] == "-" :
x1 = x1[1::]
x2 = list(x) #x2 for operators
num = ""
num_list = []
for e in x1+["dummy"] : # dummy for triggering else: for the last number
if "0" <= e <= "9" :
num += e
else :
num_list.append(int(num))
num = ""
operator_list = []
for e in x2 :
if e == "+" or e == "-" :
operator_list.append(e)
if len(num_list) > len(operator_list) : #ตัวเเรกเป็น +
ans = num_list[0]
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i+1]
elif operator_list[i] == "-" :
ans -= num_list[i+1]
print(ans)
else : #ตัวเเรกเป็นลบ
ans = 0
for i in range(len(operator_list)) :
if operator_list[i] == "+" :
ans += num_list[i]
elif operator_list[i] == "-" :
ans -= num_list[i]
print(ans)
|
# 1639383, 2022-09-24 09:29:04, PPPPP (100%)
from re import S
s = input()
x = 0
a = 0
l = []
op = '+'
for i in range(len(s)):
if '0' <= s[i] <= '9':
a *= 10
a += int(s[i])
else:
if op == '+':
l.append(a)
else:
l.append(-a)
op = s[i]
a = 0
if op == '+':
l.append(a)
else:
l.append(-a)
# print(l)
for i in l:
x += i
print(x)
| # 1639452, 2022-09-24 09:30:48, PPPPP (100%)
s = input()
x = 0
a = 0
l = []
op = '+'
for i in range(len(s)):
if '0' <= s[i] <= '9':
a *= 10
a += int(s[i])
else:
if op == '+':
l.append(a)
else:
l.append(-a)
op = s[i]
a = 0
if op == '+':
l.append(a)
else:
l.append(-a)
# print(l)
for i in l:
x += i
print(x)
| # 1641344, 2022-09-24 10:20:23, PPPPP (100%)
s = input()
x = 0
a = 0
l = []
op = '+'
for i in range(len(s)):
if '0' <= s[i] <= '9':
a *= 10
a += int(s[i])
else:
if op == '+':
l.append(a)
else:
l.append(-a)
op = s[i]
a = 0
if op == '+':
l.append(a)
else:
l.append(-a)
for i in l:
x += i
print(x)
|
# 1640439, 2022-09-24 09:57:53, -P--- (20%) #Sathana Laolugsanalerd a=input();s=t=0;m=1 for i in a: if(i=='-'):s+=t;m=-1;t=0 elif(i=='+'):s+=t;m=1;t=0 else:t=m*abs(t*10+int(i)) print(s+t) | # 1640533, 2022-09-24 10:00:07, -P--- (20%) #Sathana Laolugsanalerd a=input();s=t=0;m=1 for i in a: if(i=='-'):s+=t;m=-1;t=0 elif(i=='+'):s+=t;m=1;t=0 else:t=m*abs(t*10)+int(i) print(s+t) | # 1640577, 2022-09-24 10:01:29, PPPPP (100%) #Sathana Laolugsanalerd a=input();s=t=0;m=1 for i in a: if(i=='-'):s+=t;m=-1;t=0 elif(i=='+'):s+=t;m=1;t=0 else:t=m*(abs(t*10)+int(i)) print(s+t) |
# 1641835, 2022-09-24 10:29:46, xPPPx (60%)
yeet = input()
ans = []
prep = ""
if yeet[0] == "-" :
prep = prep + "-"
for i in range(0,len(yeet)):
if yeet[i] == "+" :
prep = prep + ","
elif yeet[i] == "-" :
prep = prep + ",-"
else :
prep = prep + yeet[i]
prep = prep.split(",")
for i in range(0,len(prep)) :
prep[i] = int(prep[i])
print(sum(prep))
| # 1642107, 2022-09-24 10:34:31, ----- (0%)
yeet = input()
ans = []
prep = ""
for i in range(0,len(yeet)):
if yeet[i] == "+" :
prep = prep + ","
elif yeet[i] == "-" :
if i == 0 : prep = prep + "-"
else : prep = prep + ",-"
else :
prep = prep + yeet[i]
prep = prep.split(",")
print(prep)
for i in range(0,len(prep)) :
prep[i] = int(prep[i])
print(sum(prep))
| # 1642122, 2022-09-24 10:34:40, PPPPP (100%)
yeet = input()
ans = []
prep = ""
for i in range(0,len(yeet)):
if yeet[i] == "+" :
prep = prep + ","
elif yeet[i] == "-" :
if i == 0 : prep = prep + "-"
else : prep = prep + ",-"
else :
prep = prep + yeet[i]
prep = prep.split(",")
for i in range(0,len(prep)) :
prep[i] = int(prep[i])
print(sum(prep))
|
# 1641317, 2022-09-24 10:19:48, -PPP- (60%)
s=input()
s+="/"
n=[]
sign=[]
if s[0]=="-":
pass
else:
sum=0
t=""
i=0
while i<len(s):
if s[i]!="+" and s[i] !="-" and s[i]!="/":
t+=s[i]
else:
n.append(int(t))
sign.append(s[i])
t=""
i+=1
sign=sign[:-1:]
for i in range(len(sign)):
if sign[i]=="+":
sum+=(n[i]+n[i+1])
sum-=n[i]
if sign[i]=="-":
sum-=(n[i]+n[i+1])
sum+=n[i]
print(sum+n[0])
| # 1641626, 2022-09-24 10:25:54, PPPPP (100%)
s=input()
s+="/"
n=[]
sign=[]
if s[0]=="-":
s=s[1::]
sum=0
t=""
i=0
while i<len(s):
if s[i]!="+" and s[i] !="-" and s[i]!="/":
t+=s[i]
else:
n.append(int(t))
sign.append(s[i])
t=""
i+=1
sign=sign[:-1:]
for i in range(len(sign)):
if sign[i]=="+":
sum+=(n[i]+n[i+1])
sum-=n[i]
if sign[i]=="-":
sum-=(n[i]+n[i+1])
sum+=n[i]
print(sum-n[0])
else:
sum=0
t=""
i=0
while i<len(s):
if s[i]!="+" and s[i] !="-" and s[i]!="/":
t+=s[i]
else:
n.append(int(t))
sign.append(s[i])
t=""
i+=1
sign=sign[:-1:]
for i in range(len(sign)):
if sign[i]=="+":
sum+=(n[i]+n[i+1])
sum-=n[i]
if sign[i]=="-":
sum-=(n[i]+n[i+1])
sum+=n[i]
print(sum+n[0])
|
# 1639995, 2022-09-24 09:45:06, PPPPP (100%)
x = input()
out = x[0]
for i in range(1,len(x)):
if '0'<=x[i]<='9' :
out += x[i]
else:
if x[i] == '-':
out += ' '+x[i]
else:
x[i] == '+'
out += ' '+x[i]
out2 = out.split()
out3 = []
for e in out2:
out3.append(int(e))
print(sum(out3))
| # 1640238, 2022-09-24 09:51:51, PPPPP (100%)
x = input()
out = x[0]
for i in range(1,len(x)):
if '0'<=x[i]<='9' :
out += x[i]
else:
if x[i] == '-':
out += ' '+x[i]
else:
x[i] == '+'
out += ' '+x[i]
out2 = out.split()
out3 = 0
for e in out2:
out3+= int(e)
print(out3)
|
# 1640032, 2022-09-24 09:46:22, ----- (0%)
strr=list(input())
sign=['+','-']
g=[]
s=0
for i in range(0,len(strr)):
if strr[i] =='+':
g.append(int(strr[i+1]))
if strr[i] =='-':
g.append(-int(strr[i+1]))
for k in range(len(g)):
s+=int(g[k])
print(s)
| # 1640771, 2022-09-24 10:06:38, PPPPP (100%)
strr=list(input())
sign=['+','-']
g=[]
s=''
summ=0
for i in range(0,len(strr)):
if strr[i] in sign:
g+=[' ']
g+=strr[i]
for k in g:
s+=k
f=[int(e) for e in s.split()]
for n in f:
summ+=n
print(summ)
|
# 1639781, 2022-09-24 09:39:11, P---P (40%)
a = input()
b = '+-'
c = ''
e = []
count = 0
p = ['0','1','2','3','4','5','6','7','8','9']
if a[0] == '-':
c = c + '-'
for i in range(1,len(a)):
if a[i] in p:
c = c + a[i]
else:
if a[i] not in p:
e = e + [c]
c = a[i]
else:
pass
if a[i] in p:
e = e + [c]
g = 0
for i in range(len(e)):
g += int(e[i])
print(g)
| # 1640164, 2022-09-24 09:50:06, PPPPP (100%)
a = input()
c = ''
e = []
h = []
j = ''
p = ['0','1','2','3','4','5','6','7','8','9']
if a[0] == '-':
c = c + '-'
for i in range(1,len(a)):
if a[i] in p:
c = c + a[i]
else:
if a[i] not in p:
e = e + [c]
c = a[i]
else:
pass
if a[i] in p:
e = e + [c]
g = 0
for i in range(len(e)):
g += int(e[i])
print(g)
else:
if a[0] in p:
j = j + a[0]
for i in range(1,len(a)):
if a[i] in p:
j = j + a[i]
else:
if a[i] not in p:
h = h + [j]
j = a[i]
else:
pass
if a[i] in p:
h = h + [j]
z = 0
for i in range(len(h)):
z += int(h[i])
print(z)
|
# 1640790, 2022-09-24 10:06:59, P---- (20%)
n= input()
s = ''
st = []
g = []
if n[0] in ['+','-']:
s += n[0]
for i in range(len(n)):
if n[i] not in ['+','-']:
s += str(n[i])
else:
g.append(str(n[i]))
if len(st) == 0:
print(int(s))
| # 1641685, 2022-09-24 10:27:00, PPPPP (100%)
n= input()
s = ''
num = []
g = []
s += n[0]
for i in range(1,len(n),1):
if n[i] not in ['+','-']:
s += str(n[i])
else:
num.append(int(s))
s = ''
s += n[i]
num.append(int(s))
if len(num) == 0:
print(int(s))
print(sum(num))
|
# 1639955, 2022-09-24 09:43:59, PPPPP (100%)
# Test_01_03
# This Code was written by Korraphat Pangvutthivanich 6530006421
nipoj = input()
to_comp = []
temp = ""
c = 0
for x in nipoj :
if c > 1 and x in "+-" :
to_comp += [int(temp)]
temp = ""
temp += x
c += 1
to_comp += [int(temp)]
print(sum(to_comp))
| # 1640270, 2022-09-24 09:52:38, PPPPP (100%)
# Test_01_03
# This Code was written by Korraphat Pangvutthivanich 6530006421
nipoj = input()
to_comp = []
temp = ""
c = 0
for x in nipoj :
if c > 0 and x in "+-" :
to_comp += [int(temp)]
temp = ""
temp += x
c += 1
to_comp += [int(temp)]
print(sum(to_comp))
|
# 1639505, 2022-09-24 09:31:57, PPTTT (40%)
txt = input().strip().split("+")
result = []
for ch in txt:
if '-' not in ch:
result.append(int(ch))
while '-' in ch:
if ch[0] == "-":
if ch.find("-",1)==-1:
result.append(int(ch))
break
else:
stop=ch.find("-",1)
result.append(int(ch[:stop]))
ch = ch[stop:]
print(sum(result))
| # 1639736, 2022-09-24 09:38:09, PPPPP (100%)
txt = input().strip()
result = ""
for ch in txt:
if ch =="-":
result += " -"
elif ch == "+":
result += " "
else: result += ch
print(sum([int(i) for i in result.split()]))
|
# 1640531, 2022-09-24 10:00:03, Pxxxx (20%)
x = input()
for i in range(len(x)):
x = int(x)
print(x)
| # 1640999, 2022-09-24 10:12:36, PPPPP (100%)
x = input()
op = ['-','+']
d = ''
for i in range(len(x)):
if x[i] in op:
d += ' ' + x[i]
else:
d += x[i]
t = d.split()
sum = 0
for e in t:
e = int(e)
sum += e
print(sum)
|
# 1641923, 2022-09-24 10:31:05, PxxxP (40%)
a = input() + "-"
b = []
c = []
for i in range(len(a)) :
if a[i] == "+" or a[i] == "-" :
b.append(a[i])
s = ""
for i in range(len(a)) :
if a[i] != "+" and a[i] != "-" :
s += a[i]
else :
c.append(s)
s = ""
if a[0] == "-" :
c.pop(0)
b.pop(-1)
j = []
for i in range(len(c)) :
h = b[i] + c[i]
j.append(h)
f = []
for i in range(len(j)) :
r = int(j[i])
f.append(r)
print(sum(f))
| # 1642262, 2022-09-24 10:36:37, PPPPP (100%)
a = input() + "-"
b = []
c = []
for i in range(len(a)) :
if a[i] == "+" or a[i] == "-" :
b.append(a[i])
s = ""
for i in range(len(a)) :
if a[i] != "+" and a[i] != "-" :
s += a[i]
else :
c.append(s)
s = ""
if a[0] == "-" :
c.pop(0)
b.pop(-1)
j = []
for i in range(len(c)) :
h = b[i] + c[i]
j.append(h)
f = []
for i in range(len(j)) :
r = int(j[i])
f.append(r)
print(sum(f))
else :
b.insert(0,"+")
b.pop(-1)
j = []
for i in range(len(c)) :
h = b[i] + c[i]
j.append(h)
f = []
for i in range(len(j)) :
r = int(j[i])
f.append(r)
print(sum(f))
|
# 1640382, 2022-09-24 09:56:13, PP--- (40%)
problem = input().strip()
ram = 0
total = 0
for i in problem:
if i in "+-":
if i == '+':
total += ram
ram = 0
else:
total -= ram
ram = 0
elif i in'0123456789':
ram *= 10
ram += int(i)
if problem[0] == '-':
total -= ram
else:
total += ram
print(total)
| # 1641786, 2022-09-24 10:28:59, PPPPP (100%)
prb = input().strip()
pn = []
nn = []
ram = 0
total = 0
for i in range(len(prb)):
if prb[i] in "+-":
if i == 0:
if prb[i] == '-':
nn += [ram]
if i > 0:
if prb[i-len(str(ram))-1] == '-':
nn += [ram]
elif prb[i-len(str(ram))-1] == '+':
pn += [ram]
else:
pn += [ram]
ram = 0
elif prb[i] in'0123456789':
ram *= 10
ram += int(prb[i])
if i == len(prb)-1:
if ram >= 0 and prb[i-len(str(ram))] == '+':
pn += [ram]
else:
nn += [ram]
total = sum(pn) - sum(nn)
print(total)
|
# 1640323, 2022-09-24 09:54:27, PxxxP (40%)
x = input()
y = []
opr = []
if "-" not in x and "+" not in x :
x = "+"+x
for i in range(len(x)) :
if x[i] == "-" :
opr += ["-"]
elif x[i] == "+" :
opr += [""]
x = list(x)
for e in range(len(x)) :
if x[e] == "-" or x[e] == "+" :
x[e] = "?"
x = "".join(x)
if x[0] == "?" :
x = x[1:]
x = x.split("?")
for r in range(len(x)) :
y += [opr[r]+x[r]]
data = [int(e) for e in y]
print(sum(data))
| # 1640371, 2022-09-24 09:55:56, PPPPP (100%)
x = input()
y = []
opr = []
if x[0] != "-" :
x = "+"+x
for i in range(len(x)) :
if x[i] == "-" :
opr += ["-"]
elif x[i] == "+" :
opr += [""]
x = list(x)
for e in range(len(x)) :
if x[e] == "-" or x[e] == "+" :
x[e] = "?"
x = "".join(x)
if x[0] == "?" :
x = x[1:]
x = x.split("?")
for r in range(len(x)) :
y += [opr[r]+x[r]]
data = [int(e) for e in y]
print(sum(data))
|
# 1640648, 2022-09-24 10:03:31, PPPP- (80%)
x = input()
y = ''
plus = []
minus = []
w = []
n = 1
for i in range(len(x)) :
if x[i] in '+-' :
y += ' '
if x[i] == '+' :
plus.append(n)
w.append(i)
n += 1
else :
minus.append(n)
w.append(i)
n += 1
else :
y += x[i]
z = y.split()
if len(z) == 1 :
print(int(x))
else :
if x[0] == '-' :
w.remove(0)
t = int(x[:min(w)])
for i in range(1,len(z)) :
if i in plus :
t += int(z[i])
elif i in minus :
t -= int(z[i])
print(t)
| # 1640856, 2022-09-24 10:08:42, PPPPP (100%)
x = input()
y = ''
plus = []
minus = []
w = []
if x[0] == '-' :
n = 0
else :
n = 1
for i in range(len(x)) :
if x[i] in '+-' :
y += ' '
if x[i] == '+' :
plus.append(n)
w.append(i)
n += 1
else :
minus.append(n)
w.append(i)
n += 1
else :
y += x[i]
z = y.split()
if len(z) == 1 :
print(int(x))
else :
if x[0] == '-' :
w.remove(0)
t = int(x[:min(w)])
for i in range(1,len(z)) :
if i in plus :
t += int(z[i])
elif i in minus :
t -= int(z[i])
print(t)
|
# 1640131, 2022-09-24 09:49:12, xPPPx (60%)
x = str(input())
s=[]
a = ['-']
g = ''
x += '+'
for e in x:
if e == '+'or e == '-':
s += [g]
g = ''
if e == '+':
pass
elif e == '-':
g += '-'
else:
g += e
m = [int(e) for e in s]
sol = sum(m)
print(sol)
| # 1640353, 2022-09-24 09:55:28, PPPPP (100%)
x = str(input())
s=[]
a = ['-']
g = ''
x += '+'
if x[0] == '-':
g += '-'
else:
g += x[0]
for e in x[1::]:
if e == '+'or e == '-':
s += [g]
g = ''
if e == '+':
pass
elif e == '-':
g += '-'
else:
g += e
m = [int(e) for e in s]
sol = sum(m)
print(sol)
|
# 1639694, 2022-09-24 09:36:54, PPPPP (100%)
x = input()
num = [""]
opr = []
order = 0
for i in range(0,len(x)):
if i != 0:
if "0" <= x[i] <= "9":
num[order] += x[i]
elif x[i] == "+":
opr += [1]
order += 1
num += [""]
elif x[i] == "-":
opr += [-1]
order += 1
num += [""]
else:
if "1" <= x[0] <= "9":
opr += [1]
num[order] += x[0]
else:
opr += [-1]
summ = 0
for i in range(len(num)):
summ += int(num[i]) * opr[i]
print(summ)
| # 1641234, 2022-09-24 10:18:18, PPPPP (100%)
x = input()
num = [""]
opr = []
order = 0
for i in range(0,len(x)):
if i != 0:
if "0" <= x[i] <= "9":
num[order] += x[i]
elif x[i] == "+":
opr += [1]
order += 1
num += [""]
elif x[i] == "-":
opr += [-1]
order += 1
num += [""]
else:
if "0" <= x[0] <= "9":
opr += [1]
num[order] += x[0]
else:
opr += [-1]
summ = 0
for i in range(len(num)):
summ += int(num[i]) * opr[i]
print(summ)
|
# 1640551, 2022-09-24 10:00:47, PPPP- (80%)
data=input()
operation=[]
digits=[]
i=0
while i!=len(data):
#for i in range(len(data)):
if data[i]=="+" or data[i]=="-":
operation.append(data[i])
i+=1
else:
digit1=""
j=i
while len(data)!=j and data[j] not in ["+","-"]:
digit1+=data[j]
j+=1
digits.append(digit1)
i=j
if len(digits)==1 and operation==[]:
result= int(digits[0])
elif len(digits)==1 and operation[0]=="-":
result= (-1*int(digits[0]))
else:
if data[0]=="-":
digits=[0]+digits
else:
operation.insert(0,"+")
digits.append(0)
for i in range(len(digits)): #แปลงเป็น int
digits[i]=int(digits[i])
result=0
for i in range(len(operation)):
if operation[i]=="-":
result+=0-digits[i]
elif operation[i]=="+":
result+=digits[i]
if operation[i]=="-":
result+=0-digits[i+1]
elif operation[i]=="+":
result+=digits[i+1]
print(result)
| # 1641239, 2022-09-24 10:18:21, PPPPP (100%)
data=input()
operation=[]
digits=[]
i=0
while i!=len(data):
#for i in range(len(data)):
if data[i]=="+" or data[i]=="-":
operation.append(data[i])
i+=1
else:
digit1=""
j=i
while len(data)!=j and data[j] not in ["+","-"]:
digit1+=data[j]
j+=1
digits.append(digit1)
i=j
if len(digits)==1 and operation==[]:
result= int(digits[0])
elif len(digits)==1 and operation[0]=="-":
result= (-1*int(digits[0]))
else:
if data[0]!="+" and data[0]!="-":
operation.insert(0,"+")
result=0
for i in range(len(operation)):
if operation[i]=="+":
result+=int(digits[i])
elif operation[i]=="-":
result+=int(digits[i])*-1
print(result)
|
# 1640707, 2022-09-24 10:05:07, xPPPx (60%)
t = input()
number = []
for i in range(len(t)):
if t[i] == "-":
number.append(i)
c = 0
for i in number:
t = t[0:i+c] + "+" + t[i+c:]
c += 1
t = t.split("+")
for i in range(len(t)):
t[i] = int(t[i])
print(sum(t))
| # 1640766, 2022-09-24 10:06:30, PPPPP (100%)
t = input()
number = []
for i in range(len(t)):
if t[i] == "-":
number.append(i)
c = 0
for i in number:
t = t[0:i+c] + "+" + t[i+c:]
c += 1
t = t.split("+")
if t[0] == "":
t.remove("")
for i in range(len(t)):
t[i] = int(t[i])
print(sum(t))
|
# 1640836, 2022-09-24 10:08:08, ----- (0%)
a = input()
b = ""
c = 0
for e in a :
if e not in "+-" :
b += e + " "
else :
b += e
b = b.split()
for i in range(len(b)) :
c += int(b[i])
print(c)
| # 1641261, 2022-09-24 10:18:50, PPPPP (100%)
a = input()
t = ""
c = 0
for e in a :
if e in "123456789" :
t += e
else :
t += " " + e
t = t.split()
for i in range(len(t)) :
c += int(t[i])
print(c)
|
# 1641975, 2022-09-24 10:32:12, PPPPP (100%)
a = input()
b = ""
n = 0
result = 0
z = ["+","-"]
for i in a:
if "0" <= i <= "9":
b += i
else:
b += " "
b = b.split()
x = [int(e) for e in b]
if a[0] != "-":
n = 1
for i in a:
if i =="+":
n += 1
if i =="-":
x[n] = x[n]*(-1)
n += 1
print(sum(x))
| # 1642448, 2022-09-24 10:38:48, PPPPP (100%)
a = input()
b = ""
n = 0
result = 0
z = ["+","-"]
for i in a:
if "0" <= i <= "9":
b += i
else:
b += " "
b = b.split()
x = [int(e) for e in b]
if a[0] !=z[1]:
n = 1
for i in a:
if i ==z[0]:
n += 1
if i ==z[1]:
x[n] = x[n]*(-1)
n += 1
print(sum(x))
|
# 1641347, 2022-09-24 10:20:24, xPPPx (60%)
x = input().strip()
a = ""
b = ""
x += " "
for i in range(len(x)):
if x[i]=="+" or x[i]=="-" or x[i]==" ":
i -= 1
break
a += x[i]
i += 1
while True:
if x[i]==" ":
break
if x[i] == "+":
for j in range(i+1,len(x)):
if x[j]=="+" or x[j]=="-" or x[j]==" ":
break
b += x[j]
a = int(a)+int(b)
i = j
b = ""
elif x[i] == "-":
for j in range(i+1,len(x)):
if x[j]=="+" or x[j]=="-" or x[j]==" ":
break
b += x[j]
a = int(a)-int(b)
i = j
b = ""
print(a)
| # 1641417, 2022-09-24 10:21:54, PPPPP (100%)
x = input().strip()
a = ""
b = ""
x += " "
if x[0]=="-":
a += "-"
x = x[1:]
for i in range(len(x)):
if x[i]=="+" or x[i]=="-" or x[i]==" ":
i -= 1
break
a += x[i]
i += 1
while True:
if x[i]==" ":
break
if x[i] == "+":
for j in range(i+1,len(x)):
if x[j]=="+" or x[j]=="-" or x[j]==" ":
break
b += x[j]
a = int(a)+int(b)
i = j
b = ""
elif x[i] == "-":
for j in range(i+1,len(x)):
if x[j]=="+" or x[j]=="-" or x[j]==" ":
break
b += x[j]
a = int(a)-int(b)
i = j
b = ""
print(a)
|
# 1639542, 2022-09-24 09:32:59, PPPPP (100%)
expression = input()
sign = 1
if(expression[0] == '-'):
sign = -1
tempNum = 0
summation = 0
numList = [str(i) for i in range(10)]
for char in expression:
if(char in numList):
tempNum *= 10
tempNum += int(char)
continue
if(char == '+'):
summation += sign*tempNum
sign = 1
tempNum = 0
continue
if(char == '-'):
summation += sign*tempNum
sign = -1
tempNum = 0
continue
summation += sign*tempNum
print(summation)
| # 1640434, 2022-09-24 09:57:47, PPPPP (100%)
expression = input()
sign = 1
if(expression[0] == '-'):
sign = -1
tempNum = 0
summation = 0
numList = [str(i) for i in range(10)]
for char in expression:
if(char in numList):
tempNum = 10*tempNum + int(char)
continue
if(char == '+'):
summation += sign*tempNum
sign = 1
tempNum = 0
continue
if(char == '-'):
summation += sign*tempNum
sign = -1
tempNum = 0
continue
summation += sign*tempNum
print(summation)
|
# 1639285, 2022-09-24 09:26:18, PPPPP (100%)
ข้อมูลนำเข้า = input()
ผลรวม = 0
พจน์ปัจจุบัน = ''
พจน์ปัจจุบันเป็นบวก = True
for ඞ in ข้อมูลนำเข้า:
if ඞ not in ['+', '-']:
พจน์ปัจจุบัน += ඞ
else:
ผลรวม += int(พจน์ปัจจุบัน if len(พจน์ปัจจุบัน)
else '0') * (1 if พจน์ปัจจุบันเป็นบวก else -1)
พจน์ปัจจุบัน = ''
พจน์ปัจจุบันเป็นบวก = ඞ == '+'
ผลรวม += int(พจน์ปัจจุบัน if len(พจน์ปัจจุบัน)
else '0') * (1 if พจน์ปัจจุบันเป็นบวก else -1)
print(ผลรวม)
| # 1639306, 2022-09-24 09:27:07, PPPPP (100%)
ข้อมูลนำเข้า = input()
ผลรวม = 0
พจน์ปัจจุบัน = ''
พจน์ปัจจุบันเป็นบวก = not not "ครัวซองรสสลัด"
for ඞ in ข้อมูลนำเข้า:
if ඞ not in ['+', '-']:
พจน์ปัจจุบัน += ඞ
else:
ผลรวม += int(พจน์ปัจจุบัน if len(พจน์ปัจจุบัน)
else '0') * (1 if พจน์ปัจจุบันเป็นบวก else -1)
พจน์ปัจจุบัน = ''
พจน์ปัจจุบันเป็นบวก = ඞ == '+'
ผลรวม += int(พจน์ปัจจุบัน if len(พจน์ปัจจุบัน)
else '0') * (1 if พจน์ปัจจุบันเป็นบวก else -1)
print(ผลรวม)
|
# 1640853, 2022-09-24 10:08:41, ----- (0%)
a=input()
ind,sum,op,now=0,0,1,0
if(a[0]=='-'): op=0
l=[]
def add(pos):
temp=0; add1=0
print(pos,now)
for j in l:
temp+=int(j)
for i in range(pos):
temp*=10
add1+=temp
pos-=1; temp=0
print(add1)
if(not op): return(-add1)
else: return(add1)
for i in range(len(a)):
now=i
if(a[i]!='-' and a[i]!='+'):
ind+=1; l.append(a[i])
else:
sum+=add(ind-1)
if(now<=len(a)):
if(a[now]=='-'): op=0
elif(a[now]=='+'): op=1
ind=0
l=[]
sum+=add(ind-1)
print(sum)
| # 1640880, 2022-09-24 10:09:13, PPPPP (100%)
a=input()
ind,sum,op,now=0,0,1,0
if(a[0]=='-'): op=0
l=[]
def add(pos):
temp=0; add1=0
for j in l:
temp+=int(j)
for i in range(pos):
temp*=10
add1+=temp
pos-=1; temp=0
if(not op): return(-add1)
else: return(add1)
for i in range(len(a)):
now=i
if(a[i]!='-' and a[i]!='+'):
ind+=1; l.append(a[i])
else:
sum+=add(ind-1)
if(now<=len(a)):
if(a[now]=='-'): op=0
elif(a[now]=='+'): op=1
ind=0
l=[]
sum+=add(ind-1)
print(sum)
|
# 1640368, 2022-09-24 09:55:55, PxxxP (40%)
def findnum(s,i):
if '0'<=s[i]<='9' :
num=''
while '0'<=s[i]<='9':
num+=s[i]
i+=1
if i>=len(s) : break
return [int(num),len(num)]
s=input()
sum=0
for i in range(0,len(s)) :
size=0
if s[i]=='+':
sum+=findnum(s,i+1)[0]
i+=findnum(s,i+1)[1]
elif s[i] =='-' :
sum-=findnum(s,i+1)[0]
i+=findnum(s,i+1)[1]
if '0'<=s[0]<='9':sum+= s[0]
print(sum)
| # 1640397, 2022-09-24 09:56:45, PPPPP (100%)
def findnum(s,i):
if '0'<=s[i]<='9' :
num=''
while '0'<=s[i]<='9':
num+=s[i]
i+=1
if i>=len(s) : break
return [int(num),len(num)]
s=input()
sum=0
for i in range(0,len(s)) :
size=0
if s[i]=='+':
sum+=findnum(s,i+1)[0]
i+=findnum(s,i+1)[1]
elif s[i] =='-' :
sum-=findnum(s,i+1)[0]
i+=findnum(s,i+1)[1]
if '0'<=s[0]<='9':sum+= findnum(s,0)[0]
print(sum)
|
# 1639324, 2022-09-24 09:27:26, PPPPP (100%)
line = input().strip()
totalsum = 0
sum = 0
pm = 1
for i in range(len(line)):
if line[i] == "+":
totalsum += sum*pm
sum = 0
pm = 1
elif line[i] == "-":
totalsum += sum*pm
sum = 0
pm = -1
else:
sum *= 10
sum += int(line[i])
totalsum += sum*pm
print(totalsum)
| # 1639561, 2022-09-24 09:33:28, PPPPP (100%)
line = input().strip()
totalsum = 0
walter_white = 0
pm = 1
for i in range(len(line)):
if line[i] == "+":
totalsum += walter_white*pm
walter_white = 0
pm = 1
elif line[i] == "-":
totalsum += walter_white*pm
walter_white = 0
pm = -1
else:
walter_white *= 10
walter_white += int(line[i])
totalsum += walter_white*pm
print(totalsum)
|
# 1640697, 2022-09-24 10:04:49, PPPPP (100%)
x = input()
new= ''
symbol = []
number = []
for i in x:
if i in '+-':
symbol.append(i)
for i in range(len(x)):
if x[i] in '+-':
new += ' '
else:
new += x[i]
number = new.split()
if len(symbol) == len(number):
number[0] = symbol[0] + number[0]
symbol= symbol[1::]
sum = int(number[0])
number = number[1::]
for i in range(len(symbol)):
if symbol[i] == '-':
sum -= int(number[i])
elif symbol[i] == '+':
sum += int(number[i])
print(sum)
|
# 1641094, 2022-09-24 10:15:13, PPPPP (100%)
t = input()
t += ' '
num = []
temp_opr = []
temp_num = ''
if t[0] == '-':
s = 1
else:
s = 0
for i in range(s,len(t)):
if t[i] == '+':
num.append(temp_num)
temp_num = ''
temp_opr.append(t[i])
elif t[i] == ' ':
num.append(temp_num)
elif t[i] != '+' and t[i] != '-':
temp_num += t[i]
elif t[i] == '-':
num.append(temp_num)
temp_num = ''
temp_opr.append(t[i])
num = [int(e) for e in num]
if t[0] == '-':
num[0] = -num[0]
ans = num[0]
for i in range(len(temp_opr)):
if temp_opr[i] == '+':
ans += num[i+1]
else:
ans -= num[i+1]
print(ans)
|
# 1640223, 2022-09-24 09:51:27, PPPPP (100%)
a = list(input())
num = ['1','2','3','4','5','6','7','8','9','0']
syb = ['+','-']
sep = []
word = ''
for i in range(0,len(a)):
if a[i] in syb:
sep += [word]
word = a[i]
else:
word += a[i]
sep += [word]
if sep[0] == '':
sep = sep[1:]
for i in range(0,len(sep)):
sep[i] = int(sep[i])
ans = sum(sep)
print(ans)
|
# 1640081, 2022-09-24 09:47:39, PPPPP (100%)
a = input().split('+')
add = []
lob = []
for i in a :
if '-' not in i :
add.append(int(i))
else :
lob.append(i)
qq = []
for i in lob :
n = 0
if i[0]=='-' :
s = i.split('-')
for e in s[1:] :
n-=int(e)
qq.append(n)
else :
s = i.split('-')
for e in s[1:] :
n-=int(e)
n+=int(s[0])
qq.append(n)
print(sum(add)+sum(qq))
|
# 1642088, 2022-09-24 10:34:13, PPPPP (100%)
x = str(input())
#เก็บตำแหน่งเครื่องหมาย
p = []
for i in range(len(x)) :
if x[i] == '+' or x[i] == '-' :
p.append(i)
p.append(len(x))
h = []
if x[0] in ['0','1','2','3','4','5','6','7','8','9'] :
h.append(x[0:p[0]])
for i in range(len(p)-1) :
h.append(x[p[i]:p[i+1]])
if x[0] == '-' :
for i in range(len(p)-1) :
h.append(x[p[i]:p[i+1]])
for u in range(len(h)) :
h[u] = int(h[u])
m = sum(h)
print(m)
|
# 1641457, 2022-09-24 10:22:39, PPPPP (100%)
i = input()
y = '+'
x = ''
f = 0
if i[0] in '1234567890' :
x += y
x += i
else :
x += i
z = ''
for e in range(len(x)) :
if x[e] == '+' or x[e] == '-' :
z += '/'
z += x[e]
else :
z += x[e]
z = z.split('/')
z.remove(z[0])
for e in range(len(z)) :
if (z[e])[0] == '+' :
f += int((z[e])[1:])
elif (z[e])[0] == '-' :
f -= int((z[e])[1:])
print(f)
|
# 1641169, 2022-09-24 10:16:53, PPPPP (100%)
L = input()
if L[0] != '-':
L = '+' + L
mark = []
num = str()
for t in L:
if (t == '+') or (t == '-'):
mark.append(t)
num += ' '
else:
num += t
K = [e for e in num.split(' ')]
for y in K:
if y == '':
K.remove(y)
N = [int(q) for q in K]
s = 0
for i in range(len(mark)):
if mark[i] == '+':
s += N[i]
elif mark[i] == '-':
s -= N[i]
print(s)
|
# 1641454, 2022-09-24 10:22:35, PPPPP (100%)
x = input()
u = ''
for i in range(len(x)):
if x[i] == '-' or x[i] == '+':
u += ' ' + x[i]
else:
u += x[i]
U = u.split()
sum = 0
for i in U:
sum += int(i)
print(sum)
|
# 1640158, 2022-09-24 09:49:51, PPPPP (100%)
a = input()
value = 0
sam = 0
c = 0
for i in range(1,len(a)):
if a[-i] in '0123456789':
value += (10**c)*int(a[-i])
c += 1
elif a[-i] in '+-':
if a[-i] == '+':
sam += value
else:
sam -= value
value = 0
c = 0
if a[0] in '0123456789':
value += (10**c)*int(a[0])
sam += value
elif a[0] == '-':
sam -= value
print(sam)
|
# 1641415, 2022-09-24 10:21:51, PPPPP (100%)
eq = input()+' '
total = 0
num = ""
i = 0
while i < len(eq)-1:
if '0'<=eq[i]<='9':
if eq[i+1] == '+'or eq[i+1] == '-'or eq[i+1]== " ":
num += eq[i]
total += int(num)
num = ''
i +=1
else:
num += eq[i]
i+=1
elif eq[i] == '+':
i+=1
elif eq[i] == '-':
k = 0
while '0'<=eq[i+k+1] <='9':
num += eq[i+k+1]
k+=1
else:
total -= int(num)
i += 1+k
num=''
print(total)
|
# 1641044, 2022-09-24 10:13:43, PPPPP (100%)
s=input().strip()
x=[]
c=0
z=s[0]=='-'
for i in range(len(s)):
if s[i]=='+':
x.append(int(s[i-c:i]))
c=0
elif s[i]=='-':
if z:
z=False
c+=1
else:
x.append(int(s[i-c:i]))
z=False
c=1
else:
c+=1
x.append(int(s[i-c+1:]))
ans=sum(x)
print(ans)
|
# 1640866, 2022-09-24 10:08:56, PPPPP (100%)
c = input()
new = ''
sigma = 0
k = [] #เครื่องหมาย
jn = [] #จำนวน
for a in range(len(c)):
if c[a] in ['-','+']:
k += [c[a]]
new += ' '
else:
new += c[a]
jn = [int(e) for e in new.split()]
if len(k) == len(jn):
for i in range(len(k)):
if k[i] == '+':
sigma += int(jn[i])
if k[i] == '-':
sigma -= int(jn[i])
else:
sigma+= int(jn[0])
newjn = jn[1:]
#print(len(jn),len(k))
for e in range(len(k)):
if k[e] == '+':
sigma += int(newjn[e])
if k[e] == '-':
sigma -= int(newjn[e])
print(sigma)
|
# 1640369, 2022-09-24 09:55:55, PPPPP (100%)
n = list(input())
beta = ''
gamma = []
sigma = []
for i in range(0, len(n)):
if n[i] == '-' and i == 0:
beta += n[0]
elif i == len(n) - 1:
beta += n[i]
gamma.append(beta)
beta = ''
elif n[i] == '-':
gamma.append(beta)
beta = ''
beta += n[i]
elif n[i] == '+':
gamma.append(beta)
beta = ''
else:
beta += n[i]
for j in range(0, len(gamma)):
sigma.append(int(gamma[j]))
alpha = sum(sigma)
print(alpha)
|
# 1641693, 2022-09-24 10:27:08, PPPPP (100%)
a=str(input())
x=list(a)
if not x[0] == '-' :
x.insert(0,'+')
x.append('+')
st=''
for i in range(len(x)) :
st += x[i]
n=x.count('+')+x.count('-')
count=1
m=[]
p=''+ st[0]
while count < len(x) :
if st[count] != '+' and st[count] != '-' :
p += st[count]
else :
m.append(int(p))
p=st[count]
count +=1
print(sum(m))
|
# 1640322, 2022-09-24 09:54:25, PPPPP (100%)
s = input().split("+")
s1 = list()
for x in s :
s2 = ''
for y in x :
if y == "-" and len(s2)!= 0 :
s1.append(int(s2))
s2=''
s2+=y
s1.append(int(s2))
sum1 = 0
for x in s1 :
sum1+=x
print (sum1)
|
# 1641748, 2022-09-24 10:28:15, PPPPP (100%)
s = input()+" "
l1 = []
ints = ""
for i in s:
if i in "-+":
l1.append(ints)
ints = ""
ints += i
elif i in "1234567890":
ints += i
else:
l1.append(int(ints))
for i in l1:
if i == "":
l1.remove(i)
l2 = [int(e) for e in l1]
print(sum(l2))
|
# 1640670, 2022-09-24 10:04:01, PPPPP (100%)
s = input()
y = ''
for i in range(len(s)) :
if s[i] != '+' and s[i] != '-' :
y += s[i]
if s[i] == '+' :
y += ' '
if s[i] == '-' :
y += ' ' + s[i]
x = [int(e) for e in y.split()]
sum_x = sum(x)
print(sum_x)
|
# 1640452, 2022-09-24 09:58:23, PPPPP (100%)
def str2eq(string):
s = list(string)
eq = []
n = -1
num = ''
for i in range(len(s)):
if ' ' in s:
s.remove(' ')
for i in range(len(s)):
num = ''
if s[i] in ['+','-']:
for j in range(n+1,i):
num += s[j]
fx = s[i]
eq.append(num)
eq.append(fx)
n = i
for i in range(n+1,len(s)):
num += s[i]
eq.append(num)
return eq
#-----------------------------------------
def calculate(equation):
eq = equation
while '-' in eq:
i = eq.index('-')
eq[i] = -1*int(eq[i+1])
eq[i+1] = 0
while '+' in eq:
eq.remove('+')
while '' in eq:
eq.remove('')
while ' ' in eq:
eq.remove(' ')
for e in range(len(eq)):
eq[e] = int(eq[e])
return sum(eq)
#----------------------------------------------
string = input()
print(calculate(str2eq(string)))
|
# 1640430, 2022-09-24 09:57:40, PPPPP (100%)
s = input()
s += "+"
sum = 0
num = ""
c=0
if s[0]!="-":
num = "+"
c=1
for i in range(len(s)):
if '0'<=s[i]<='9':
num+=s[i]
elif s[i]=="+" or s[i]=="-":
c+=1
if c==2:
sum += int(num)
num=""
c=1
num+=s[i]
print(sum)
|
# 1642085, 2022-09-24 10:34:12, PPPPP (100%)
x = input()
c = x[0]
d = ""
intx = []
ope = []
sum = 0
intx2 = []
for i in range (1,len(x)):
if x[i] != '+' and x[i] != '-' :
c += x[i]
else :
intx.append(c)
c = x[i]
intx.append(c)
for i in range (len(intx)):
intx2.append(int(intx[i]))
for i in range (len(intx2)):
sum += intx2[i]
print(sum)
|
# 1640467, 2022-09-24 09:58:40, PPPPP (100%)
a=input().strip()
sum=0
PM='+'
x='0'
i=['1','2','3','4','5','6','7','8','9','0']
pm=['+','-']
for b in a:
if b in i:
x+=b
elif b in pm:
if PM=='+':
sum+=int(x)
elif PM=='-':
sum-=int(x)
PM=b
x='0'
if PM=='+':
sum+=int(x)
elif PM=='-':
sum-=int(x)
print(sum)
|
# 1642386, 2022-09-24 10:38:06, PPPPP (100%)
n = input()
k = 0
while len(n) > k:
for i in range(len(n)):
if n[i] == '-' and n[i-1] != ' ':
n = n[0:i] + ' -' + n[i+1:len(n)]
k += 1
for i in range(len(n)):
if n[i] == '+' and n[i-1] != " ":
n = n[0:i] + ' ' + n[i+1:len(n)]
a = [int(e) for e in n.split()]
y = sum(a)
print(y)
|
# 1639938, 2022-09-24 09:43:39, PPPPP (100%)
x = input()
ans = []
temp = ''
for i in x:
if i in ['+','-']:
if len(temp) != 0:
ans.append(int(temp))
temp = ''
if i == '+':
pass
elif i == '-':
temp += '-'
else:
temp += i
if temp != '':
ans.append(int(temp))
print(sum(ans))
|
# 1640666, 2022-09-24 10:03:57, PPPPP (100%)
x = input()
y = x.replace("-",",-")
z = y.replace ("+",",+")
l = z.split(",")
if l[0] == "":
l.pop(0)
for i in range(len(l)):
if l[i][0] == "+":
l[i] = l[i][1:len(l[i])]
l[i] = int(l[i])
else:
l[i] = int(l[i])
print(str(sum(l)))
|
# 1640627, 2022-09-24 10:03:03, PPPPP (100%)
a=str(input())
sum=0
p=[]
n=''
n+=a[0]
for i in range(1,len(a)):
if a[i]=='+':
sum+=int(n)
n=''
elif a[i]=='-':
sum+=int(n)
n='-'
elif a[i] in ['0','1','2','3','4','5','6','7','8','9']:
n+=a[i]
sum+=int(n)
print(sum)
|
# 1640156, 2022-09-24 09:49:50, PPPPP (100%)
search = input()
form = ""
for x in search :
if x == "+" :
form += " " + x
elif x == "-" :
form += " " + x
else :
form += x
final = form.split()
total = 0
for y in final :
z = int(y)
total += z
print(total)
|
# 1640843, 2022-09-24 10:08:19, PPPPP (100%)
c = str(input())
a =""
b = ""
k = 0
if c[0] != "-":
a += "+"
for e in c:
a += e
else:
a = c
for i in range(len(a)):
if a[i] == "-":
for e in a[i+1::]:
if e in ["+","-"]: break
b += e
b = int(b)
k -= b
b = ""
j = "-"
elif a[i] == "+":
for e in a[i+1::]:
if e in ["+","-"]: break
b += e
b = int(b)
k += b
b = ""
j = "+"
print(k)
|
# 1639961, 2022-09-24 09:44:09, PPPPP (100%)
x = input().split('+')
for i in range(len(x)):
m = x[i].split('-')
if m[0] == '':
x[i] = -sum(int(e) for e in m[1:])
else:
x[i] = int(m[0]) - sum(int(e) for e in m[1:])
print(sum(x))
|
# 1640222, 2022-09-24 09:51:26, PPPPP (100%)
inp = str(input())
def stminus(inp):
inlist = []
temp = ""
inlist.append(-1)
for i in range(1,len(inp)):
if inp[i] == "-":
inlist.append(int(temp))
inlist.append(-1)
temp = ""
elif inp[i] == "+":
inlist.append(int(temp))
inlist.append(1)
temp = ""
else:
temp += inp[i]
if i == len(inp) - 1: inlist.append(int(temp))
return inlist
def stplus(inp):
inlist = []
temp = ""
inlist.append(1)
for i in range(len(inp)):
if inp[i] == "-":
inlist.append(int(temp))
inlist.append(-1)
temp = ""
elif inp[i] == "+":
inlist.append(int(temp))
inlist.append(1)
temp = ""
else:
temp += inp[i]
if i == len(inp) - 1: inlist.append(int(temp))
return inlist
if inp[0] == "-": inlist = stminus(inp)
else: inlist = stplus(inp)
sum = 0
for i in range(0,len(inlist),2):
sum += inlist[i]*inlist[i+1]
print(sum)
|
# 1641451, 2022-09-24 10:22:34, PPPPP (100%)
n = input()
a = ["+","-"]
c = [] #lene=lenc+1
e = []
s = n[0]
for i in range(1,len(n)) :
if n[i] not in a :
s += n[i]
else :
c += n[i]
e += [s]
s = ""
e += [s]
e = [int(a) for a in e]
p = e[0]
for i in range(len(c)) :
if c[i] == "+" :
p += e[i+1]
elif c[i] == "-" :
p -= e[i+1]
print(p)
|
# 1640421, 2022-09-24 09:57:25, PPPPP (100%)
ip = input()
num = ['0','1','2','3','4','5','6','7','8','9']
n = ''
for i in range(len(ip)):
if ip[i] in num :
n += ip[i]
elif ip[i] == '+':
n += ' '
elif ip[i] == '-':
n += ' -'
N = [ int(i) for i in n.split() ]
print(sum(N))
|
# 1641271, 2022-09-24 10:19:02, PPPPP (100%)
x = input()
n = ""
b = ""
for ch in x :
if ch in ["+","-"] :
n += " "
else :
n += ch
for ch in x :
if ch in ["0","1","2","3","4","5","6","7","8","9"] :
b += " "
else :
b += ch
k = b.split()
y = n.split()
s = "+"
c = []
t = 0
if len(k) != len(y) :
k.insert(0,s)
for i in range(len(k)) :
if k[i] == "-" :
z = int(y[i])*-1
c.append(z)
else :
u = int(y[i])
c.append(u)
for i in range(len(c)) :
t += c[i]
print(t)
|
# 1640129, 2022-09-24 09:49:10, PPPPP (100%)
y = str(input())
listy = []
signi = []
sign = []
result = 0
for i in range(0, len(y)):
if (y[i] == '-' or y[i] == '+'):
signi.append(i)
for i in y:
listy.append(i)
for i in range(1,len(listy)):
if (i in signi):
listy[i] = 'x'
new_y = "".join(listy)
list2 = new_y.split('x')
for i in range(0, len(list2)):
list2[i] = int(list2[i])
for i in signi:
sign.append(y[i])
if(str(y)[0] == '-'):
sign.pop(0)
result = list2[0]
for i in range(0,len(sign)):
if (sign[i] == '+'):
result += list2[i+1]
elif (sign[i] == '-'):
result -= list2[i+1]
# print(list2)
# print(sign)
print(result)
|
# 1640668, 2022-09-24 10:03:58, PPPPP (100%)
a = input()
if a[0]!='-':
a = '+'+a
m = []
for i in range(len(a)):
if a[i] == '+':
m.append('+')
elif a[i] == '-':
m.append('-')
n = []
q = 0
for i in range(len(a)):
if (a[i] == '+' or a[i] == '-'):
n.append(a[q+1:i])
q = i
n.append(int(a[q+1:]))
ni = []
for i in range(1,len(n)):
ni.append(int(n[i]))
ans = 0
for i in range(len(m)):
if m[i] == '+':
ans+=ni[i]
else:
ans-=ni[i]
print(ans)
|
# 1639965, 2022-09-24 09:44:13, PPPPP (100%)
x = list(input())
y = ['+','-']
z = []
v = []
for i in range(len(x)):
if x[i] not in y:
z.append(x[i])
else:
v.append(''.join(z))
v.append(x[i])
z=[]
v.append(''.join(z))
if v[0] == '':
v.remove('')
c = 0
if v[0] == '-':
for a in range(0,len(v),2):
if v[a] == '-':
c -= int(v[a+1])
elif v[a] == '+':
c += int(v[a+1])
else:
for a in range(1,len(v),2):
if v[a] == '-':
c -= int(v[a+1])
elif v[a] == '+':
c += int(v[a+1])
c += int(v[0])
print(c)
|
# 1639551, 2022-09-24 09:33:07, PPPPP (100%)
x=input()
y=''
for i in range(len(x)):
if x[i]=='+':
y+=' '
elif x[i]=='-':
y+=' -'
else:
y+=x[i]
k=[int(e) for e in y.split()]
print(sum(k))
|
# 1640547, 2022-09-24 10:00:42, PPPPP (100%)
s = input()
count = []
c = ""
pn = []
for i in range(len(s)):
if i == 0 and s[i] == "-":
continue
if s[i] == "+" or s[i] == "-":
pn.append(s[i])
c += " "
continue
c += s[i]
c1 = c.split()
for i in range(len(c1)):
if i == 0 and s[0] == "-":
count.append(int(c1[i])*(-1))
else:
count.append(int(c1[i]))
result = count[0]
for i in range(len(count)):
if i == len(count)-1:
break
if pn[i] == "-":
result = result - count[i+1]
elif pn[i] == "+":
result = result + count[i+1]
print(result)
|
# 1640884, 2022-09-24 10:09:19, PPPPP (100%)
data = input()
li = []
sy = []
nu = ''
k = '5555'
if data[0] == '-':
k = 'R'
data = data[1::]
for i in range(len(data)):
if data[i] in '0123456789':
nu += data[i]
else:
li.append(int(nu))
nu = ''
li.append(data[i])
li.append(int(nu))
ans = li[0]
if k == 'R':
ans = -li[0]
for i in range(len(li)):
if li[i] == '+':
ans += li[i+1]
elif li[i] == '-':
ans -= li[i+1]
print(ans)
|
# 1640928, 2022-09-24 10:10:34, PPPPP (100%)
a = input()
a += '+'
sym = ['+','-']; w = ''; num = []
for i in range(len(a)):
if a[i] in sym:
num.append(w)
w = ''
if a[i] == sym[1]:
w += a[i]
elif a[i] == sym[0]:
w += a[i]
else:
w += a[i]
#print(num)
toint = []
for e in num:
if len(e)>0:
if e[0] == '+':
toint.append(int(e[1:]))
elif e[0] == '-':
toint.append(-int(e[1:]))
else:
toint.append(int(e))
#print(toint)
print(sum(toint))
|
# 1639865, 2022-09-24 09:41:22, PPPPP (100%)
n = input()
x = ''
for e in n:
if e in ['-','+']:
if e == '-':
x += ' -'
elif e == '+':
x += ' '
else:
x += e
num = x.split()
s = []
for e in num:
s.append(int(e))
print(sum(s))
|
# 1639630, 2022-09-24 09:35:02, PPPPP (100%)
x = list(input())
a = ''
z = []
sum = 0
for i in range(len(x)):
if x[i] in '+-':
z.append(x[i])
x[i] = ' '
a = ''.join(x)
a = a.split()
if len(z) != len(a):
z.insert(0,'+')
for e in range(len(a)):
if z[e] == '+':
sum += int(a[e])
elif z[e] == '-':
sum -= int(a[e])
# print(a)
# print(z)
print(sum)
|
# 1640189, 2022-09-24 09:50:39, PPPPP (100%)
s=input()
l=[]
if s[0]!='-':
sp=s.split("+")
for i in range(len(sp)):
sm=sp[i].split("-")
l.append([int(e) for e in sm])
ls=[]
su=0
for i in range(len(l)):
for e in range(1,len(l[i])):
l[i][0]-=l[i][e]
ls.append(l[i][0])
su+=ls[i]
print(su)
else:
sp=s.split("-")
sp.remove(sp[0])
for i in range(len(sp)):
sm=sp[i].split("+")
l.append([int(e) for e in sm])
ls=[]
su=0
for i in range(len(l)):
for e in range(1,len(l[i])):
l[i][0]-=l[i][e]
ls.append(l[i][0])
su+=ls[i]
print(su*(-1))
|
# 1641799, 2022-09-24 10:29:09, PPPPP (100%)
x = list(input()) + ['OJO']
num = '0123456789'
op = '+-'
n = []
o = []
z = []
for i in range(len(x)):
if x[i] in num :
z.append(x[i])
else :
o.append(x[i])
if z != [] :
n.append(''.join(z))
z = []
n = [int(e) for e in n]
if x[0] == '-':
s = -n[0]
o.remove(o[0])
else :
s = n[0]
if len(o) != 0 :
for i in range(len(o)):
if o[i] == '+':
s += n[i+1]
if o[i] == '-':
s -= n[i+1]
print(s)
|
# 1640471, 2022-09-24 09:58:46, PPPPP (100%)
x = input()
a = ''
y = ['+','-']
b = []
c = 0
for i in range(len(x)):
if x[0] in y:
b.append(-1)
else:
b.append(1)
if x[i] not in y:
a += x[i]
else:
if x[i] == y[0]:
if len(a) > 0:
c += b[0]*int(a)
b = [1]
a = ''
elif x[i] == y[1]:
if len(a) > 0:
c += b[0]*int(a)
b = [-1]
a = ''
c += b[0]*int(a)
print(c)
|
# 1639787, 2022-09-24 09:39:14, PPPPP (100%)
a = '0'+input()
w = ''
s = []
for x in a :
if "0"<= x <= "9" :
w += x
else :
s.append(x)
w += ' '
num = [int(e) for e in w.split()]
c = num[0]
for i in range(len(s)) :
if s[i] == '+' :
c += num[i+1]
if s[i] == '-' :
c -= num[i+1]
print(c)
|
# 1640250, 2022-09-24 09:52:06, PPPPP (100%)
s = input()
n = []
start = 0
for i in range(len(s) - 1):
if i != (len(s) - 2):
if (s[i + 1] == '+') or (s[i + 1] == '-'):
n.append(int(s[start: (i + 1)]))
start = (i + 1)
else:
n.append(int(s[start: (i + 2)]))
sum = 0
for i in range(len(n)):
sum += n[i]
print(sum)
|
# 1639330, 2022-09-24 09:27:36, PPPPP (100%)
t = input()
m = ''
for i in t:
if i == '+':
m += ' '
elif i == '-':
m += ' -'
else:
m += i
o = [int(e) for e in m.split()]
print(sum(o))
|
# 1639426, 2022-09-24 09:30:08, PPPPP (100%)
x = input()
y = []
z = ''
for i in range(len(x)):
if i == 0 and x[0] == '-':
z += x[0]
elif i == len(x)-1:
z += x[i]
y.append(int(z))
elif x[i] == '+' or x[i] == '-':
y.append(int(z))
z = ''
z += x[i]
else:
z += x[i]
print(sum(y))
|
# 1640200, 2022-09-24 09:50:51, PPPPP (100%)
num = [str(e) for e in range(0,10)]
x = input().strip()+'.'
n = ''
op = '+'
ans = 0
for i in range(len(x)-1) :
if x[i] not in num :
op = x[i]
elif x[i] in num :
n+=x[i]
if x[i+1] not in num :
ans += int(op+n)
n = ''
print(ans)
|
# 1639850, 2022-09-24 09:41:00, PPPPP (100%)
s = input()
asum = 0
t = ""
if s[0] == "-":
pos_neg = False
s = s[1:]
else:
pos_neg = True
for i in s:
if i != "+" and i != "-":
t += i
elif i == "+":
if pos_neg == True:
asum += int(t)
else:
asum -= int(t)
pos_neg = True
t = ""
elif i == "-":
if pos_neg == True:
asum += int(t)
else:
asum -= int(t)
pos_neg = False
t = ""
if pos_neg == True:
asum += int(t)
else:
asum -= int(t)
print(asum)
|
# 1639983, 2022-09-24 09:44:36, PPPPP (100%)
x=input().strip()
ans=[]
mem=0
for i in range(1,len(x)):
if x[i] in ['-','+']:
ans.append(int(x[mem:i]))
mem=i
ans.append(int(x[mem:]))
print(sum(ans))
|
# 1640261, 2022-09-24 09:52:21, PPPPP (100%)
s = input()
m = ''
c = 0
for e in s:
if '0' <= e <= '9':
m += e
else:
m += ' '
m = [int(e) for e in m.split()]
if s[0] != '-':
c = 1
for e in s:
if e == '+':
c += 1
if e == '-':
m[c] *= -1
c += 1
print(sum(m))
|
# 1640628, 2022-09-24 10:03:03, PPPPP (100%)
x = input()
s = 0
c = 0
x2 = x
for i in range(len(x)):
if x[i] == '-' or x[i] == '+':
x2 = x2[:i+c] + ' ' + x2[i+c] + ' ' + x2[i+c+1:]
c += 2
a = x2.split()
if a[0] == '-':
for i in range(1,len(a),2):
if a[i-1] == '-':
s -= int(a[i])
elif a[i-1] == '+':
s += int(a[i])
else:
a = ['+'] + a
for i in range(1,len(a),2):
if a[i-1] == '-':
s -= int(a[i])
elif a[i-1] == '+':
s += int(a[i])
print(s)
|
# 1641445, 2022-09-24 10:22:26, PPPPP (100%)
s = input()
numl = []
expl = []
sum = 0
for i in range(len(s)):
if s[i] == "-":
expl.append("-")
elif s[i] == "+":
expl.append("+")
l1 = s.split("+")
for e in l1:
l2 = e.split("-")
for t in l2:
numl.append(t)
if numl[0] == '':
sum += -int(numl[1])
expl.remove("-")
numl = numl[2:]
for i in range(len(expl)):
if expl[i] == "-":
sum += -int(numl[i])
elif expl[i] == "+":
sum += int(numl[i])
else:
sum += int(numl[0])
numl = numl[1:]
for i in range(len(expl)):
if expl[i] == "-":
sum += -int(numl[i])
elif expl[i] == "+":
sum += int(numl[i])
print(sum)
|
# 1639470, 2022-09-24 09:31:13, PPPPP (100%)
s = input()
k,t = "",0
for e in s:
if e == "+":
k += " "
if e == "-":
k += " -"
else:
k += e
k = k.split()
for i in range(len(k)):
k[i] = int(k[i])
t += k[i]
print(t)
|
# 1641251, 2022-09-24 10:18:34, PPPPP (100%)
data = input()
x = []
sym = []
num = []
blank = ''
for i in range(len(data)):
if data[i] == '+' or data[i] == '-':
sym.append(data[i])
if blank != '':
num.append(int(blank))
blank = ''
else:
blank+=data[i]
if blank != '':
num.append(int(blank))
if len(sym) != len(num):
sym.insert(0,'+')
for i in range(len(sym)):
x.append(sym[i])
x.append(num[i])
sum = 0
for i in range(1,len(x),2):
if x[i-1] == '+':
sum += x[i]
else:
sum -= x[i]
print(sum)
|
# 1639715, 2022-09-24 09:37:29, PPPPP (100%)
ops = ["+", "-"]
eqn = input()
eqn_list = []
if eqn[0] == "-":
eqn = "0" + eqn
r = ""
for i in range(len(eqn)):
if eqn[i] not in ops:
r += eqn[i]
else:
eqn_list.append(r)
eqn_list.append(eqn[i])
r = ""
if i == len(eqn) - 1:
eqn_list.append(r)
operand = [int(x) for x in eqn_list[::2]]
operators = eqn_list[1::2]
res = operand[0]
j = 0
for i in range(1,len(operand)):
if operators[j] == "+":
res += operand[i]
elif operators[j] == "-":
res -= operand[i]
j += 1
print(res)
|
# 1642241, 2022-09-24 10:36:20, PPPPP (100%)
x = input().strip()
x = x.replace('+', ' ').replace('-', ' -').split(' ')
if x[0] == '' :
x.remove(x[0])
for i in range(0,len(x)) :
x[i] = int(x[i])
s = sum(x)
print(s)
|
# 1640204, 2022-09-24 09:50:58, PPPPP (100%)
m = input()
s = 0
n = [1]
t = ''
for i in range(len(m)):
if i == 0 and m[i] == '-' :
n = [-1]
t += ' '
elif m[i] == '-' :
n.append(-1)
t += ' '
elif m[i] == '+' :
n.append(1)
t += ' '
else :
t += m[i]
t = t.split()
#print(n,t)
for j in range(len(t)):
s += n[j] * int(t[j])
print(s)
|
# 1641021, 2022-09-24 10:13:04, PPPPP (100%)
x = input()
num = ""
result = 0
for i in range(len(x)):
if x[i] in "+-":
break
num += x[i]
try:
result += int(num)
except: pass
num = ""
for i in range(len(x)):
if x[i] == "-":
for j in range(i+1,len(x)):
if x[j] in "1234567890":
num += x[j]
if x[j] in "+-":
break
result -= int(num)
num =""
if x[i] == "+":
for j in range(i+1,len(x)):
if x[j] in "1234567890":
num += x[j]
if x[j] in "+-":
break
result += int(num)
num =""
print(result)
|
# 1640840, 2022-09-24 10:08:13, PPPPP (100%)
x = input()
y = ''
a = ''
n = list()
s = 0
for e in x:
if e == '-' or e == '+':
a += e
if y != '':
n.append(int(y))
y = ''
else:
y += e
n.append(int(y))
# print(a, n)
if len(n) == len(a):
s -= n[0]
for i in range(1, len(n)):
if a[i] == '-':
s -= n[i]
else:
s += n[i]
else:
s += n[0]
for i in range(1, len(n)):
if a[i-1] == '-':
s -= n[i]
else:
s += n[i]
print(s)
|
# 1640041, 2022-09-24 09:46:34, PPPPP (100%)
a = input()
b = a.replace('+', ' ').replace('-', ' ').split()
c = []
for i in a:
if i == '+' or i == '-':
c.append(i)
value = 0
if len(c) == len(b):
for i in range(len(b)):
value = value + int((c[i]) + b[i])
else:
for i in range(len(b)):
if i == 0:
value = value + int(b[i])
else:
value = value + int((c[i - 1]) + b[i])
print(value)
|
# 1641643, 2022-09-24 10:26:18, PPPPP (100%)
e = input() + "+"
num = "0"
exp = []
numlist = []
for i in range(len(e)):
if e[i] != '+' and e[i] != '-':
num+=e[i]
elif e[i] == '+' or e[i] == '-':
exp.append(e[i])
numlist.append(int(num))
num = "0"
sum = numlist[0]
for i in range(len(exp)-1):
if exp[i] == '+':
sum+=numlist[i+1]
elif exp[i] == '-':
sum-=numlist[i+1]
print(sum)
|
# 1640217, 2022-09-24 09:51:21, PPPPP (100%)
a = input()
if a[0] == "-" :
negative = True
else :
negative = False
num = []
operation = []
operationb4 = ""
numb4 = ""
for e in a :
if e == "+" or e == "-" :
numb4 += " "
else :
numb4 += e
num = [int(e) for e in numb4.split()]
for t in a :
if t == "+" :
operationb4 += t
if t == "-" :
operationb4 += t
else :
operationb4 += " "
operation = operationb4.split()
if negative == True :
num[0] = (-1)*num[0]
operation.pop(0)
for i in range(len(operation)) :
if operation[i] == "-" :
num[i+1] = (-1)*num[i+1]
print(sum(num))
|
# 1640941, 2022-09-24 10:10:54, PPPPP (100%)
n = input()
lst= []
sum = 0
if n[0] in ['+', '-']:
s = 1
for i in range(1,len(n)):
if n[i] in ['+', '-']:
lst.append(n[s-1:i])
s = i+1
lst.append(n[s-1:])
else:
s = 1
for i in range(len(n)):
if n[i] in ['+', '-']:
lst.append(n[s-1:i])
s = i+1
lst.append(n[s-1:])
for e in lst:
if e[0] == '+':
sum += int(e[1:])
if e[0] == '-':
sum -= int(e[1:])
if e[0] not in ['+', '-']:
sum += int(e)
print(sum)
|
# 1639468, 2022-09-24 09:31:12, PPPPP (100%)
s = input()
res = 0
tmp = '0'
for c in s:
if not c.isdigit():
res += int(tmp)
tmp = c
else:
tmp += c
res += int(tmp)
print(res)
|
# 1639270, 2022-09-24 09:26:00, PPPPP (100%)
inStr = input()
expr = '+'
hodl = 0
result = 0
for c in inStr: # parse until no values left
if(c == '+' or c == '-'):
# dump hodl into result, then re-initiate hodl/expr
if(expr == '-'):
hodl *= -1
result += hodl
hodl = 0
expr = c
else:
# number: add it to hodl.
hodl *= 10
hodl += int(c)
# dump again
if(expr == '-'):
hodl *= -1
result += hodl
hodl = 0
print(result)
|
# 1639754, 2022-09-24 09:38:35, PPPPP (100%)
a = input()
s = ''
if a[0] != '-':
a = '+'+a
for i in range(len(a)):
if a[i] != '+' and a[i] != "-":
s = s +a[i]
else:
s = s + " " + a[i]
s = s[1:]
l = [int(e) for e in s.split()]
t = 0
for i in range(len(l)):
t += l[i]
print(t)
|
# 1639479, 2022-09-24 09:31:25, PPPPP (100%)
s=input()
k=0
q=''
b=[]
t=[]
if s[0]=='-':
s=s[1:]
b.append('-')
for i in s:
if i=='+':
b.append(i)
t.append(int(q))
q=''
elif i=='-':
b.append(i)
t.append(int(q))
q=''
else:
q=q+i
t.append(int(q))
if(len(b)<len(t)):
b.insert(0,'+')
u=0
for i in b:
if i=='-':
k=k-t[u]
if i=='+':
k=k+t[u]
u+=1
print(k)
|
# 1640357, 2022-09-24 09:55:32, PPPPP (100%)
x=input()
list=[]
strr=x[0]
for i in range(1,len(x)):
if x[i] == '+' or x[i] == '-':
list.append(int(strr))
list.append(x[i])
strr = ''
else:
strr = strr + x[i]
if i == len(x)-1:
list.append(int(strr))
sum = list[0]
for i in range(2,len(list),2):
if list[i-1] == '-':
sum -= list[i]
else:
sum += list[i]
print(sum)
|
# 1640197, 2022-09-24 09:50:48, PPPPP (100%)
s = input()
s += '+'
temp_st = ""
temp_int = 0
fn = ""
sum = 0
i = 0
if s[0] == '-':
fn = '-'
i += 1
else :
fn = '+'
for i in range(len(s)) :
if (s[i] == '-' or s[i]=='+') and i != 0 :
if fn == '+' :
sum += int(temp_st)
else :
#print(fn,'1')
#print(int(temp_st))
sum -= abs(int(temp_st))
temp_st = ""
fn = s[i]
else :
temp_st += s[i]
print(sum)
|
# 1640564, 2022-09-24 10:01:04, PPPPP (100%)
s=input().strip()
l=[]
j=0
for i in range(1,len(s)):
if s[i]=='+':
l.append(int(s[j:i]))
j=i+1
elif s[i]=='-':
l.append(int(s[j:i]))
j=i
elif i==len(s)-1:
l.append(int(s[j:]))
print(sum(l))
|
# 1639171, 2022-09-24 09:23:49, PPPPP (100%)
s = input()
ans = 0
sgn = '+'
temp = ''
for i in range(len(s)):
if s[i] in '+-':
if len(temp) > 0:
val = int(temp)
if sgn == '-':
val *= -1
ans += val
temp = ''
sgn = s[i]
else:
temp += s[i]
if len(temp) > 0:
val = int(temp)
if sgn == '-':
val *= -1
ans += val
print(ans)
|
# 1639568, 2022-09-24 09:33:41, PPPPP (100%)
n = input()
sum = 0
s = 0
m = 1
for i in range(len(n)-1, -1, -1):
if n[i].isdigit():
s += int(n[i])*m
m *= 10
else:
if n[i] == '-':
sum -= s
else:
sum += s
s = 0
m = 1
if n[0].isdigit(): sum += s
print(sum)
|
# 1639129, 2022-09-24 09:22:56, PPPPP (100%)
expression = input().split('+')
ans = 0
for e in expression :
e2 = e.split('-')
if len(e2) == 1 :
ans += int(e2[0])
else :
sum = int(e2[0]) if len(e2[0]) > 0 else 0
for x in e2[1:] :
sum -= int(x)
ans += sum
print(ans)
|
# 1638824, 2022-09-24 09:15:59, PPPPP (100%)
print(sum(int(x) for x in (input().replace('+', ' +').replace('-', ' -').split())))
|
# 1639624, 2022-09-24 09:34:54, PPPPP (100%)
s=input()
if(s[0]!='+' or s[0]!='-'):
s = '+'+s
temp=num=sum=ch=0
for e in s:
if(e=='+' or e=='-'):
sum += (num*ch)
ch = (-1)**(e=='-')
num=0
else:
num = num*10 + int(e)
temp = num
print(sum+(num*ch))
|
# 1639564, 2022-09-24 09:33:32, PPPPP (100%)
a = input()
symbol = '+-'
numbers = '0123456789'
m = 1
sum = 0
i = 0
while(i < len(a)) :
if a[i] == '-' :
m = -1
i += 1
elif(a[i] in numbers) :
get_string_number = ""
while True :
if(i >= len(a)) :
break
if a[i] in symbol :
break
else :
get_string_number += a[i]
i += 1
get_number = int(get_string_number)
sum += get_number * m
m = 1
else :
i += 1
print(sum)
|
# 1640213, 2022-09-24 09:51:15, PPPPP (100%)
s = input()
total = 0
i = 0
num = '0'
lst = '+'
while (i < len(s)):
if (s[i].isalnum()):
num += s[i]
else:
# print(num)
if (lst == '+'):
total += int(num)
else:
total -= int(num)
num = ''
lst = s[i]
i += 1
if (lst == '+'):
total += int(num)
else:
total -= int(num)
print(total)
|
# 1640468, 2022-09-24 09:58:42, PPPPP (100%)
s = input()
s = s+'-'
opr = ['+','-','*','/']
tmp = -1;i=0
if s[i]=='+' or s[i]=='-' or s[i]=='*' or s[i]=='/': tmp = -1;i+=1
else: tmp = 1
num = ''
while True and i<len(s):
if s[i]=='+' or s[i]=='-' or s[i]=='*' or s[i]=='/': break
else: num = num+s[i]
i+=1
ans = int(num)*tmp
if i<len(s):
tmp = s[i]; i+=1
num = ''
while i<len(s):
if s[i]=='+' or s[i]=='-' or s[i]=='*' or s[i]=='/':
if tmp == '+': ans = ans+int(num)
elif tmp =='-': ans = ans-int(num)
elif tmp =='*': ans = ans*int(num)
elif tmp =='/': ans = ans/int(num)
tmp = s[i]
num = ''
else:
num = num+s[i]
i+=1
print(ans)
|
# 1639758, 2022-09-24 09:38:38, PPPPP (100%)
inp = input().strip()
curr = 0
next = ""
found = 0
if inp[0] != '-' : inp = '+' + inp
for i in range(len(inp)) :
if inp[i] in '+-' and found == 1 :
op = next[0]
num = int(next[1:])
if op == '+' : curr += num
elif op == '-' : curr -= num
next = ""
next += inp[i]
found = 1
if next != "" :
op = next[0]
num = int(next[1:])
if op == '+' : curr += num
elif op == '-' : curr -= num
print(curr)
|
# 1639734, 2022-09-24 09:38:03, PPPPP (100%)
s = input()
s += '?'
x = []
ind = 0
for i in range(len(s)):
if i == 0 and s[i] == '-': pass
elif s[i] == '+' or s[i] == '-' or s[i] == '*' or s[i] == '/':
x.append(int(s[ind:i]))
if s[i] == '-': ind = i
else: ind = i + 1
elif s[i] == '?':
x.append(int(s[ind:i]))
sum = 0
for e in x:
sum += e
print(sum)
|
# 1640194, 2022-09-24 09:50:43, PPPPP (100%)
k = input()
res = list()
v = sum = 0
for i in range(len(k)) :
if k[i]=='+' :
res += [k[v:i]]
v = i+1
elif k[i]=='-' :
res += [k[v:i]]
v = i
res += [k[v:i+1]]
for x in res :
if x!='' : sum += int(x)
print(sum)
|
# 1639123, 2022-09-24 09:22:36, PPPPP (100%)
s = input()
cur = ""
if s[0] == '-':
cs = '-'
s = s[1:]
else:
cs = '+'
res = 0
for x in s:
if x == '+' or x == '-':
if cs == '+':
res += int(cur)
cur = ""
elif cs == '-':
res -= int(cur)
cur = ""
cs = x
else:
cur += x
if cs == '+':
res += int(cur)
elif cs == '-':
res -= int(cur)
print(res)
|
# 1639981, 2022-09-24 09:44:34, PPPPP (100%)
exp = input().strip()
ans = 0
if(exp[0] == '-'):
curr_operand = '-'
exp = exp[1:]
else:
curr_operand = ''
for i in range(len(exp)):
if(exp[i].isdigit()):
curr_operand += exp[i]
elif(curr_operand != '-'):
ans += int(curr_operand)
curr_operand = '' if exp[i] != '-' else '-'
ans += int(curr_operand if curr_operand != '' and curr_operand != '-' else 0)
print(ans)
|
# 1639530, 2022-09-24 09:32:29, PPPPP (100%)
w = input()
l = []
sum = 0
num = "0"
minus = False
for i in range(len(w)):
if(w[i]=="-"):
n = int(num)
if(minus==True):
n*=-1
sum+=n
num = "0"
minus = True
elif(w[i]=="+"):
n = int(num)
if(minus==True):
n*=-1
sum+=n
num = "0"
minus = False
else:
num+=w[i]
n = int(num)
if(minus==True):
n*=-1
sum+=n
print(sum)
|
# 1639604, 2022-09-24 09:34:31, PPPPP (100%)
s = input()
a = s
b = s
a = a.replace('-', ' ')
a = a.replace('+', ' ')
l = [int(x) for x in a.split()]
sm = 0
if s[0] == '-':
sm = -l[0]
else:
sm = l[0]
i=1
for x in s[1:]:
if x.isdigit():
continue
if x=='+':
sm += l[i]
else:
sm -= l[i]
i+=1
print(sm)
|
# 1639423, 2022-09-24 09:30:04, PPPPP (100%)
S = input()
sum = 0
currnum = 0
pos = 1
for i in range(0, len(S)):
if S[i] == '-':
sum += currnum * pos
currnum = 0
pos = -1
elif S[i] == '+':
sum += currnum * pos
currnum = 0
pos = 1
else:
if currnum == 0:
currnum = int(S[i])
else:
currnum *= 10
currnum += int(S[i])
sum += currnum * pos
print(sum)
|
# 1639909, 2022-09-24 09:42:42, PPPPP (100%)
str = input()
ans = 0
num = "0"
for e in str:
if (e == "+"):
ans += int(num)
num = ""
elif (e == "-"):
ans += int(num)
num = "-"
else:
num += e
print(ans + int(num))
|
# 1639353, 2022-09-24 09:28:19, PPPPP (100%)
raw = input().split("+")
res = 0
for s in raw:
cur = s.split("-")
if cur[0] != "":
res += int(cur[0])
res += -1*sum(list(map(int, cur[1:])))
print(res)
# print(raw[0].split("-")[0])
|
# 1638956, 2022-09-24 09:18:56, PPPPP (100%)
x = input()
now = ""
neg = False
ans = 0
for i in range(len(x)):
if x[i]=='-' and i==0:
neg = True
continue
if x[i].isnumeric():
now+=x[i]
else:
if neg: ans+=(-1)*int(now)
else: ans+=int(now)
now = ""
if x[i]=='-': neg = True
else: neg = False
if neg: ans+=(-1)*int(now)
else: ans+=int(now)
print(ans)
|
# 1639596, 2022-09-24 09:34:20, PPPPP (100%)
inp = input()
sum = 0
cur = 0
prev = 1
for e in inp + '+':
if e == '+' or e == '-':
sum += cur*prev
cur = 0
if e == '+':
prev = 1
else:
prev = -1
else:
cur = cur*10 + int(e)
print(sum)
|
# 1639227, 2022-09-24 09:25:07, PPPPP (100%)
inp = input()
cnt = 0
num = 0
pos = 1
for i in inp:
if i=='-':
cnt+=pos*num
num = 0
pos = -1
elif i=='+':
cnt+=pos*num
num=0
pos = 1
else:
num=num*10+int(i)
cnt+=pos*num
print(cnt)
|
# 1639267, 2022-09-24 09:25:59, PPPPP (100%)
s=input()
a=[]
num=''
for i in range(len(s)):
if i==0 and s[i]!='-':
a.append('+')
num+=s[i]
elif s[i]=='+' or s[i]=='-':
if num!='':
a.append(num)
num=''
a.append(s[i])
else:
num+=s[i]
a.append(num)
b=[]
for i in range(1, len(a), 2):
if a[i-1]=='-':
b.append(int(a[i])*-1)
else:
b.append(int(a[i]))
print(sum(b))
|
# 1641336, 2022-09-24 10:20:09, PPPPP (100%)
a=input()
if a[0]!='-':
a='+'+a
n=[]
for i in range(0,len(a)):
if a[i]=='-' or a[i]=='+':
b=''
b+=a[i]
j=0
while i+j+1<len(a) and a[i+j+1]!='-' and a[i+j+1]!='+':
b+=a[i+j+1]
j+=1
n.append(int(b))
print(sum(n))
|
# 1641051, 2022-09-24 10:13:52, PPPPP (100%)
x=str(input())
c=""
num=[]
for i in range(0,len(x)):
if x[i]=="+":
c+=" "
elif x[i]=="-":
c+=" "+"-"
num+=[i]
else:
c+=x[i]
d=c.split()
if d[0]=="-":
p=d[0]+d[1]
d.remove(d[0])
d.remove(d[0])
d.insert(0,p)
sum=0
for i in range(len(d)):
sum+=int(d[i])
print(sum)
|
# 1639913, 2022-09-24 09:42:49, PPPPP (100%)
x = input().strip()
number_str = ''
lst_number = []
for c in x:
if c.isdigit():
number_str += c
else:
lst_number.append(number_str)
lst_number.append(c)
number_str = ''
lst_number.append(number_str)
if lst_number[0] == '':
lst_number[0] = 0
last_number = int(lst_number[0])
else:
last_number = int(lst_number[0])
for i in range(len(lst_number)):
if i%2 == 1:
if lst_number[i] == '+':
last_number += int(lst_number[i+1])
elif lst_number[i] == '-':
last_number -= int(lst_number[i+1])
print(last_number)
|
# 1641390, 2022-09-24 10:21:14, -PPPP (80%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(sum(n1)+sum(p1)+int(s))
| # 1641752, 2022-09-24 10:28:18, -PPPP (80%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(int(sum(n1)+sum(p1)+int(s)))
| # 1642270, 2022-09-24 10:36:44, Pxxxx (20%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
if sum(n1)+sum(p1)+int(s) == -int(p):
print(int(p))
else:
print(sum(n1)+sum(p1)+int(s))
| # 1642295, 2022-09-24 10:37:03, -PPPx (60%)
p = input()
if p[0] == '-':
save = -int(p)
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
# print(save)
if sum(n1)+sum(p1)+int(s) == 0:
# if p == save:
# print(int(p))
# else:
print('-'+str(save))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(sum(n1)+sum(p1)+int(s))
| # 1642343, 2022-09-24 10:37:33, -PPPx (60%)
p = input()
if p[0] == '-':
save = -int(p)
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
# print(save)
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# else:
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(sum(n1)+sum(p1)+int(s))
| # 1642359, 2022-09-24 10:37:43, -PPPP (80%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(int(sum(n1)+sum(p1)+int(s)))
| # 1642437, 2022-09-24 10:38:42, Pxxxx (20%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
elif sum(n1)+sum(p1)+int(s) == -int(p):
print(int(p))
else:
print(int(sum(n1)+sum(p1)+int(s)))
| # 1642452, 2022-09-24 10:38:51, -PPPP (80%)
p = input()
s = ''
n = '1234567890'
pos = []
neg = []
c = 1
for i in range(len(p)-1):
if p[i] == '-':
s += p[i]
c = 0
elif p[i] == '+':
s += p[i]
c = 1
elif c == 0:
s += p[i]
if p[i+1] not in n:
neg.append(s)
s = ''
elif c == 1:
s += p[i]
if p[i+1] not in n:
pos.append(s)
s = ''
s = ''
for i in range(len(p)-1,0,-1):
# print(str(p[i]))
if str(p[i]) not in n:
s = str(p[i]) +s
break
s = str(p[i]) +s
n1 = [int(e) for e in neg]
p1 = [int(e) for e in pos]
if sum(n1)+sum(p1)+int(s) == 0:
print(int(p))
# print(p[len(p)-2])
# print(p[len(p)-2])
# print(s)
else:
print(int(sum(n1)+sum(p1)+int(s)))
|
# 1641653, 2022-09-24 10:26:21, PPPP- (80%)
x=input()
a=[]
b=[]
c=''
d=0
for i in range(len(x)):
if '0'<=x[i]<='9':
c+=x[i]
if len(x)==i:
c+=x[i]
a.append(c)
else:
a.append(c)
c=''
if x[i]=='+':
b.append(x[i])
elif x[i]=='-':
b.append(x[i])
if len(b)==0:
print(x)
else:
if x[0]=='-':
for i in range(1,len(b)):
if b[i]=='-':
d-=int(a[i])
elif b[i]=='+':
d+=int(a[i])
else:
d+=int(a[0])
for i in range(len(b)-1):
if b[i]=='-':
d-=int(a[i+1])
else:
d+=int(a[i+1])
if b[len(b)-1]=="-":
d-=int(c)
elif b[len(b)-1]=="+":
d+=int(c)
print(d)
| # 1641915, 2022-09-24 10:31:00, PPPP- (80%)
x=input()
a=[]
b=[]
c=''
d=0
for i in range(len(x)):
if '0'<=x[i]<='9':
c+=x[i]
if len(x)==i:
c+=x[i]
a.append(c)
else:
a.append(c)
c=''
if x[i]=='+':
b.append(x[i])
elif x[i]=='-':
b.append(x[i])
if len(b)==0:
print(x)
else:
if x[0]=='-':
for i in range(1,len(b)):
if b[i]=='-':
d-=int(a[i])
elif b[i]=='+':
d+=int(a[i])
else:
d+=int(a[0])
for i in range(len(b)-1):
if b[i]=='-':
d-=int(a[i+1])
else:
d+=int(a[i+1])
if b[len(b)-1]=="-":
d-=int(c)
elif b[len(b)-1]=="+":
d+=int(c)
print(d)
| # 1642048, 2022-09-24 10:33:34, PPPP- (80%)
x=input()
a=[]
b=[]
c=''
d=0
for i in range(len(x)):
if '0'<=x[i]<='9':
c+=x[i]
if len(x)==i:
c+=x[i]
a.append(c)
else:
a.append(c)
c=''
if x[i]=='+':
b.append(x[i])
elif x[i]=='-':
b.append(x[i])
if len(b)==0:
print(x)
else:
if x[0]=='-':
for i in range(1,len(b)):
if b[i]=='-':
d-=int(a[i])
elif b[i]=='+':
d+=int(a[i])
elif x[0]!='-':
d+=int(a[0])
for i in range(len(b)-1):
if b[i]=='-':
d-=int(a[i+1])
else:
d+=int(a[i+1])
if b[len(b)-1]=="-":
d-=int(c)
elif b[len(b)-1]=="+":
d+=int(c)
print(d)
|
# 1640109, 2022-09-24 09:48:21, xPPPx (60%)
x = input()
op = ["+","-"]
listd = []
listo = []
num = ""
for c in x:
if c in op:
listo.append(c)
listd.append(int(num))
num = ""
else:
num += c
listd.append(int(num))
s = 0
if len(listo) == len(listd):
for e in listo:
if e == "-":
listd[s] = -(listd[s])
s += 1
else:
s += 1
for e in listo:
if e == "-":
listd[s] = -(listd[s])
s += 1
print(sum(listd))
| # 1640179, 2022-09-24 09:50:26, PPPP- (80%)
x = input()
op = ["+","-"]
listd = []
listo = []
num = ""
for c in x:
if c in op:
listo.append(c)
if num != "":
listd.append(int(num))
num = ""
else:
num += c
listd.append(int(num))
s = 0
if len(listo) == len(listd):
for e in listo:
if e == "-":
listd[s] = -(listd[s])
s += 1
else:
s += 1
for e in listo:
if e == "-":
listd[s] = -(listd[s])
s += 1
print(sum(listd))
|
# 1640221, 2022-09-24 09:51:25, x---x (0%)
a = input().strip() + "+"
b = []
sym = []
num = ""
c = []
for s in a:
b.append(s)
print(b)
for i in range(len(a)):
if b[i] != "+" and b[i] != "-":
num += b[i]
else:
sym.append(b[i])
c.append(int(num))
num = ""
ans = c[0]
for i in range(len(c) - 1):
ans += int(sym[i] + str(c[i + 1]))
print(ans)
| # 1640231, 2022-09-24 09:51:41, x---x (0%)
a = input().strip() + "+"
b = []
sym = []
num = ""
c = []
for s in a:
b.append(s)
print(b)
for i in range(len(a)-1):
if b[i] != "+" and b[i] != "-":
num += b[i]
else:
sym.append(b[i])
c.append(int(num))
num = ""
ans = c[0]
for i in range(len(c) - 1):
ans += int(sym[i] + str(c[i + 1]))
print(ans)
| # 1641074, 2022-09-24 10:14:30, -P--- (20%)
a = input() + "+"
num = ""
ans = 0
b = []
if a[0] == "-":
a = a[1:]
for i in range(len(a)):
if a[i] != "-" and a[i] != "+":
num += a[i]
else:
b.append(int(a[i] + str(num)))
num = ""
for i in range(len(b)):
ans += int(b[i])
else:
for i in range(len(a)):
if a[i] != "-" and a[i] != "+":
num += a[i]
else:
b.append(int(a[i] + str(num)))
num = ""
for i in range(len(b)):
ans += int(b[i])
print(ans)
| # 1641792, 2022-09-24 10:29:01, PPP-- (60%)
a = input() + "+"
t = list(a)
sym = []
num_list = []
num = ""
ans = 0
if t[0] == "-":
t = t[1:]
for i in range(len(t)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
sym[-1] = "-"
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
else:
for i in range(len(a)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
sym = sym[::-1]
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
print(ans)
| # 1642268, 2022-09-24 10:36:40, PP--- (40%)
a = input() + "+"
t = list(a)
sym = []
num_list = []
num = ""
ans = 0
if t[0] == "-":
t = t[1:]
for i in range(len(t)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
sym[-1] = "-"
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
else:
for i in range(len(a)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
z = 0
for i in range(len(sym)):
if sym[i] == "-":
z += 1
for i in range(z):
sym = sym[::-1]
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
print(ans)
| # 1642319, 2022-09-24 10:37:20, PPP-- (60%)
a = input() + "+"
t = list(a)
sym = []
num_list = []
num = ""
ans = 0
if t[0] == "-":
t = t[1:]
for i in range(len(t)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
sym[-1] = "-"
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
else:
for i in range(len(a)):
if t[i] != "+" and t[i] != "-":
num += t[i]
else:
sym.append(t[i])
num_list.append(num)
num = ""
sym = sym[::-1]
for i in range(len(sym)):
ans += int(sym[i] + str(num_list[i]))
print(ans)
|
# 1641853, 2022-09-24 10:29:59, xPPPx (60%)
x= input()
l=[]
c=''
d=0
for i in range(len(x)):
if x[i] not in '+-' :
c += x[i]
else:
l.append(c)
c=x[i]
k=x.index(l[-1]) + len(l[-1])
l.append(x[k:])
l1=[]
for i in range(len(l)):
if l[i][0] == '+':
l1.append(int(l[i][1:]))
elif l[i][0] == '-':
l1.append(-1*(int(l[i][1:])))
else:
l1.append(int(l[i]))
print(sum(l1))
| # 1641889, 2022-09-24 10:30:32, xPPPx (60%)
x= input()
l=[]
c=''
for i in range(len(x)):
if x[i] not in '+-' :
c += x[i]
else:
l.append(c)
c=x[i]
k=x.index(l[-1]) + len(l[-1])
l.append(x[k:])
l1=[]
for i in range(len(l)):
if l[i][0] == '+':
l1.append(int(l[i][1:]))
elif l[i][0] == '-':
l1.append(-1*(int(l[i][1:])))
else:
l1.append(int(l[i]))
print(sum(l1))
|
# 1641650, 2022-09-24 10:26:21, xxxxx (0%)
a = input()
b = []
c = []
ans = 0
for i in range(len(a)-1) :
if a[i] == '+' :
b.append(a[i+1])
elif a[i] == '-' :
c.append(a[i+1])
print(sum(b)-sum(c))
| # 1641668, 2022-09-24 10:26:39, PPP-- (60%)
a = input().split('-')
s = []
b=[]
for e in a :
try :
b.append([int(k) for k in e.split('+')])
except:
pass
if a[0] =='':
b[0][0] = -b[0][0]
for k in b :
s.append(-sum(k))
s[0] = -s[0]
print(sum(s))
|
# 1642023, 2022-09-24 10:33:08, xPPPx (60%)
x = input()
s = []
n = ''
ans = 0
for i in range(len(x)):
if x[i] != '+' and x[i] != '-':
n += x[i]
else:
s.append(n)
s += x[i]
n = ''
s.append(n)
if len(s) == 1:
ans += int(s[0])
else:
if s[0] != '+' and s[0] != '-':
ans += int(s[0])
s.remove(s[0])
else:
if s[i] == '-':
ans -= int(s[i+1])
if s[i] == '+':
ans += int(s[i+1])
s.remove(s[0])
s.remove(s[1])
for i in range(len(s)-1):
if s[i] == '-':
ans -= int(s[i+1])
if s[i] == '+':
ans += int(s[i+1])
print(ans)
| # 1642096, 2022-09-24 10:34:18, xPPPx (60%)
x = input()
s = []
n = ''
ans = 0
for i in range(len(x)):
if x[i] != '+' and x[i] != '-':
n += x[i]
else:
s.append(n)
s += x[i]
n = ''
s.append(n)
if len(s) == 1:
ans += int(s[0])
else:
if s[0] != '+' and s[0] != '-':
ans += int(s[0])
s.remove(s[0])
else:
if s[i] == '-':
ans -= int(s[i+1])
if s[i] == '+':
ans += int(s[i+1])
s.remove(s[0])
s.remove(s[1])
if s != []:
for i in range(len(s)-1):
if s[i] == '-':
ans -= int(s[i+1])
if s[i] == '+':
ans += int(s[i+1])
print(ans)
|
# 1642368, 2022-09-24 10:37:51, ----- (0%)
STR = '9999-999+99-9'
X = STR.split('+')
Y = []
Z = []
for i in X :
Y += [i.split('-')]
for j in Y :
if STR[0] == '-' :
a = -int(Y[0][0])
for k in range(1,len(j)) :
a -= int(Y[0][k])
Z.append(a)
a = int(j[1])
for k in range(2,len(j)) :
a -= int(j[k])
Z.append(a)
else :
a = int(j[0])
for k in range(1,len(j)) :
a -= int(j[k])
Z.append(a)
ans = sum(Z)
print(sum(Z))
| # 1642470, 2022-09-24 10:39:06, xPPPx (60%)
STR = input()
X = STR.split('+')
Y = []
Z = []
for i in X :
Y += [i.split('-')]
for j in Y :
if STR[0] == '-' :
a = -int(Y[0][0])
for k in range(1,len(j)) :
a -= int(Y[0][k])
Z.append(a)
a = int(j[1])
for k in range(2,len(j)) :
a -= int(j[k])
Z.append(a)
else :
a = int(j[0])
for k in range(1,len(j)) :
a -= int(j[k])
Z.append(a)
ans = sum(Z)
print(sum(Z))
|
# 1641440, 2022-09-24 10:22:19, P---- (20%)
inp = input()
d = []
cal = []
for i in range(len(inp)):
d.append(inp[i])
str_tonum = '0'
#[+,3,3,3,-,6,6,6,+,3,3,]
for i in range(len(inp)):
if inp[i] in ['+','-']:
str_tonum += inp[i]
cal.append([str_tonum[0:-2]])
else:
str_to_num = '0'
str_tonum += inp[i]
cal.append(str_tonum)
ans = cal[-1]
ans = ans[1:]
print(ans)
| # 1642097, 2022-09-24 10:34:19, xPPPx (60%)
inp = input()
d = []
cal = []
for i in range(len(inp)):
d.append(inp[i])
str_tonum = ''
#[+,3,3,3,-,6,6,6,+,3,3,]
#[+,5,+,6,+7]
for i in range(len(inp)):
if inp[i] not in ['+','-']:
str_tonum += inp[i]
else:
cal.append(int(str_tonum))
str_tonum = ''
str_tonum += inp[i]
cal.append(int(str_tonum))
print(sum(cal))
|
# 1642347, 2022-09-24 10:37:36, xPPPx (60%)
string = input()
s = []
for cha in string :
s.append(cha)
s.append('q')
numbers = '0123456789'
algebra = '+-*/'
a = []
for cha in string :
if cha in algebra :
a.append(cha)
index_of_a = []
for i in range(len(a)) :
index_of_a.append(string.index(a[i]))
num = []
n = ''
for i in range(len(s)) :
if s[i] in numbers :
n += s[i]
elif s[i] in algebra :
num.append(str(n))
num.append(s[i])
n = ''
elif s[i] == 'q' :
num.append(n)
sums = int(num[0])
for i in range(len(num)-1) :
if num[i] in algebra :
if num[i] == '+' :
sums += int(num[i+1])
elif num[i] == '-' :
sums -= int(num[i+1])
elif num[i] == '*' :
sums *= int(num[i+1])
elif num[i] == '/' :
sums /= int(num[i+1])
print(sums)
|
# 1642269, 2022-09-24 10:36:43, xPPPx (60%)
op = ['+','-']
s = input()
a = []
for i in range(len(s)):
a.append(s[i])
total = 0 ; x = '' ; num = [] ; ope = []
for i in a:
if i not in op:
x += i
else:
num.append(x)
ope.append(i)
x = ''
num.append(x)
f_num = [int(e) for e in num]
total += f_num[0]
for i in range(len(ope)):
if ope[i] == op[0]:
total += f_num[i+1]
else:
total -= f_num[i+1]
print(total)
|
# 1641569, 2022-09-24 10:24:50, PPxxx (40%)
x=input()
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
| # 1641665, 2022-09-24 10:26:30, compilation error (0%)
x=input()
if "+"inx:
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
else:
g=x.split("-")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
| # 1641698, 2022-09-24 10:27:13, compilation error (0%)
x=input()
if "+"in x:
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
if"-"in x :
g=x.split("-")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
| # 1641725, 2022-09-24 10:27:52, compilation error (0%)
x=input()
if "+"in x:
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
if "-" in x :
g=x.split("-")
v=-int(g[0])
for i in range(1,len(g)):
v-=int(g[i])
print(v)
| # 1641753, 2022-09-24 10:28:18, compilation error (0%)
x=input()
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
| # 1641798, 2022-09-24 10:29:05, PPxxx (40%)
x=input()
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
| # 1641813, 2022-09-24 10:29:24, xP-xx (20%)
x=input()
if "+"in x:
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
if "-" in x :
g=x.split("-")
v=-int(g[0])
for i in range(1,len(g)):
v-=int(g[i])
print(v)
| # 1641885, 2022-09-24 10:30:28, xP-xx (20%)
x=input()
if "+"in x :
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
else:
g=x.split("-")
v=-int(g[0])
for i in range(1,len(g)):
v-=int(g[i])
print(v)
| # 1641918, 2022-09-24 10:31:02, PPxxx (40%)
x=input()
g=x.split("+")
v=int(g[0])
for i in range(1,len(g)):
v+=int(g[i])
print(v)
|
# 1640170, 2022-09-24 09:50:21, PPxxx (40%)
x= [int(e) for e in input().split('+')]
print(sum(x))
| # 1640443, 2022-09-24 09:58:02, xx-xx (0%)
x= [int(e)*-1 for e in input().split('-')]
#x= [int(e) for e in input().split('+')]
print(x)
| # 1640450, 2022-09-24 09:58:17, xx-xx (0%)
x= [int(e)*-1 for e in input().split('-')]
#x= [int(e) for e in input().split('+')]
print(sum(x))
| # 1640495, 2022-09-24 09:59:15, PPxxx (40%)
x= [int(e) for e in input().split('+')]
print(sum(x))
| # 1640655, 2022-09-24 10:03:47, compilation error (0%)
#x=[int(e)*-1 for e in input().split('-')]
x= [int(e) for e in input().split('+'),int(e)*-1 for e in input().split('-')2+]
print(x)
| # 1640685, 2022-09-24 10:04:24, compilation error (0%)
#x=[int(e)*-1 for e in input().split('-')]
x= [int(e) for e in input().split('+'),int(e)*-1 for e in input().split('-')2+]
print(sum(x))
| # 1640691, 2022-09-24 10:04:37, compilation error (0%)
#x=[int(e)*-1 for e in input().split('-')]
x= [int(e) for e in input().split('+'),int(e)*-1 for e in input().split('-')2+]
print(sum(x))
| # 1641420, 2022-09-24 10:21:57, --xxx (0%)
x=[int(e) for e in input().split('-'and'+')]
print(x)
| # 1641437, 2022-09-24 10:22:17, PPxxx (40%)
x=[int(e) for e in input().split('-'and'+')]
print(sum(x))
|
# 1641279, 2022-09-24 10:19:08, Pxxxx (20%) x=input() print(int(x)) | # 1641638, 2022-09-24 10:26:08, xxxxx (0%)
x = input()
b =[]
sumn=0
c = 0
num = ['0','1','2','3','4','5','6','7','8','9']
for i in range(len(x)-1):
if x[i]=='-':
sumn -= x[i-1]
elif x[i]=='+':
sumn -= x[i-1]
print(sumn)
| # 1641666, 2022-09-24 10:26:33, ----- (0%)
x = input()
b =[]
sumn=0
c = 0
num = ['0','1','2','3','4','5','6','7','8','9']
for i in range(len(x)-1):
if x[i]=='-':
sumn -= int(x[i-1])
elif x[i]=='+':
sumn -= int(x[i-1])
print(sumn)
| # 1641710, 2022-09-24 10:27:28, Pxxxx (20%) x=input() print(int(x)) | # 1642076, 2022-09-24 10:34:05, xP--x (20%)
x = input()
b = ''
sumn=0
for e in x:
if e not in ['-','+']:
b+=e
elif e == '-':
sumn-= abs(int(b))
b = ''
elif e == '+':
sumn+=int(b)
b = ''
sumn +=int(b)
print(sumn)
| # 1642380, 2022-09-24 10:38:01, xP--x (20%)
x = input()
b = ''
sumn=0
if x[0]=='-':
print(int(x))
else:
for e in x:
if e not in ['-','+']:
b+=e
elif e == '+':
sumn+=int(b)
b = ''
sumn +=int(b)
print(sumn)
| # 1642467, 2022-09-24 10:39:03, PP--x (40%)
x = input()
b = ''
sumn=0
if x[0]=='-':
print(int(x))
else:
for e in x:
if e not in ['-','+']:
b+=e
elif e == '+':
sumn+=int(b)
b = ''
sumn +=int(b)
print(sumn)
|
# 1641004, 2022-09-24 10:12:42, ----- (0%) print(0) | # 1641023, 2022-09-24 10:13:05, ----- (0%) print(20) | # 1641267, 2022-09-24 10:18:55, xxxxx (0%)
x = input().split("+")
print(sum(x))
| # 1641354, 2022-09-24 10:20:34, PPxxx (40%)
x = [int(e) for e in input().split("+")]
print(sum(x))
| # 1641394, 2022-09-24 10:21:19, xx-xx (0%)
x = [int(e) for e in input().split("-")]
print(sum(x)*(-1))
| # 1641515, 2022-09-24 10:23:59, PPxxx (40%)
x = [int(e) for e in input().split("+")]
print(sum(x))
|
# 1638919, 2022-09-24 09:18:03, Pxxxx (20%) x=int(input()) print(x) | # 1639519, 2022-09-24 09:32:18, Pxxxx (20%) x=str(input()) x1=int(x) print(x1) | # 1640555, 2022-09-24 10:00:50, PPxxx (40%)
x=str(input()).split('+')
ans=0
for i in range(len(x)):
ans+=int(x[i])
print(ans)
| # 1641555, 2022-09-24 10:24:39, xx-xx (0%)
x=str(input()).split('-')
ans=0
for i in range(len(x)):
ans-=int(x[i])
print(ans)
| # 1641573, 2022-09-24 10:24:51, PPxxx (40%)
x=str(input()).split('+')
ans=0
for i in range(len(x)):
ans+=int(x[i])
print(ans)
|
# 1640833, 2022-09-24 10:08:06, P---- (20%)
x=input()
if '+-' not in x:
print(x)
| # 1641498, 2022-09-24 10:23:38, ----- (0%)
x=input()
number=[] ; express=[]
for e in x:
if e not in '+-':
number.append(e)
else:
express.append(e)
sum=0
for i in range(len(number)):
sum+=int(number[i])
print(sum)
| # 1641642, 2022-09-24 10:26:18, ----- (0%)
x=input()
if '+' not in x and '-' not in x:
print(x)
else:
number=[] ; express=[]
for e in x:
if e not in '+-':
number.append(e)
else:
express.append(e)
sum=0
for i in range(len(number)):
sum+=int(number[i])
print(sum)
| # 1641804, 2022-09-24 10:29:16, PPxxx (40%)
x=input().split('+')
sum=0
for e in x:
sum+=int(e)
print(sum)
| # 1642249, 2022-09-24 10:36:28, PP--- (40%)
x=input()
if '-' not in x:
sum=0
x=x.split('+')
for e in x:
sum+=int(e)
print(sum)
elif '+' not in x:
po=0
x='0'+x
x=x.split('-')
for f in x:
po-=int(f)
print(po)
|
# 1641727, 2022-09-24 10:27:52, PP--- (40%)
x = input()
if '+' not in x and '-' in x:
if x[0] == '-':
y = [int(e) for e in x[1:].split('-')]
elif x[0] != '-':
y = [int(e) for e in x.split('-')]
print('-',sum(y),sep='')
if '-' not in x:
z = [int(e) for e in x.split('+')]
print(sum(z))
| # 1642204, 2022-09-24 10:35:50, xxxxx (0%)
x = input()
if '+' not in x and '-' in x:
if x[0] == '-':
y = [int(e) for e in x[1:].split('-')]
elif x[0] != '-':
y = [int(e) for e in x.split('-')]
print('-',sum(y),sep='')
if '-' not in x:
z = [int(e) for e in x.split('+')]
print(sum(z))
for i in range(len(x)):
if x[i] == '-':
p.append(x[i])
p -= int(x[i+1])
elif x[i] == '+':
p += int(x[i+1])
print(p)
| # 1642227, 2022-09-24 10:36:09, PP--- (40%)
x = input()
if '+' not in x and '-' in x:
if x[0] == '-':
y = [int(e) for e in x[1:].split('-')]
elif x[0] != '-':
y = [int(e) for e in x.split('-')]
print('-',sum(y),sep='')
if '-' not in x:
z = [int(e) for e in x.split('+')]
print(sum(z))
| # 1642289, 2022-09-24 10:36:58, xPxxx (20%)
x = input()
if '+' not in x and '-' in x:
if x[0] == '-':
y = [int(e) for e in x[1:].split('-')]
elif x[0] != '-':
y = [int(e) for e in x.split('-')]
print('-',sum(y),sep='')
if '-' not in x:
z = [int(e) for e in x.split('+')]
print(sum(z))
else:
p = 0
q = []
for i in range(len(x)):
if x[i] == '-':
p.append(x[i])
p -= int(x[i+1])
elif x[i] == '+':
p += int(x[i+1])
print(p)
| # 1642307, 2022-09-24 10:37:12, PP--- (40%)
x = input()
if '+' not in x and '-' in x:
if x[0] == '-':
y = [int(e) for e in x[1:].split('-')]
elif x[0] != '-':
y = [int(e) for e in x.split('-')]
print('-',sum(y),sep='')
if '-' not in x:
z = [int(e) for e in x.split('+')]
print(sum(z))
|
# 1640653, 2022-09-24 10:03:45, ----- (0%)
x = input().split('+')
t = []
for i in x:
if '-' in i:
i.split('-')
for e in range(len(str(i))):
t += i[e]
else:
t += i
while '-' in t:
c = t.index('-')
x = t.pop(c+1)
t.insert(c+1,'-'+x)
t.remove('-')
t = [int(e) for e in t]
total = sum(t)
print(total)
| # 1641797, 2022-09-24 10:29:04, -Pxxx (20%)
x = input().split('+')
t = []
c = []
for i in x:
if '0'<=i<='9':
t.append(i)
elif '-' in i:
i.split('-')
for e in range(len(str(i))):
t += i[e]
while '-' in t:
c = t.index('-')
x = t.pop(c+1)
t.insert(c+1,'-'+x)
t.remove('-')
t = [int(e) for e in t]
total = sum(t)
print(total)
| # 1641868, 2022-09-24 10:30:11, -Pxxx (20%)
x = input().split('+')
t = []
c = []
for i in x:
if '0'<=i<='9':
t.append(i)
elif '-' in i:
i.split('-')
for e in range(len(str(i))):
t.append(i[e])
while '-' in t:
c = t.index('-')
x = t.pop(c+1)
t.insert(c+1,'-'+x)
t.remove('-')
t = [int(e) for e in t]
total = sum(t)
print(total)
| # 1642072, 2022-09-24 10:33:59, PPxxx (40%)
x = input().split('+')
t = []
c = []
for i in x:
i.split('-')
if '0'<=i<='9':
t.append(i)
# elif '-' in i:
# i.split('-')
# for e in range(len(str(i))):
# t.append(i[e])
#while '-' in t:
# c = t.index('-')
# x = t.pop(c+1)
# t.insert(c+1,'-'+x)
# t.remove('-')
t = [int(e) for e in x]
total = sum(t)
print(total)
| # 1642286, 2022-09-24 10:36:56, PPxxx (40%)
x = input().split('+')
t = []
for i in x:
i.split('-')
if '0'<=i<='9':
t.append(i)
elif '0'<=i[1]<='9':
t.append(i)
t = [int(e) for e in t]
total = sum(t)
print(total)
|
# 1641219, 2022-09-24 10:17:58, xPP-x (40%)
x = input()
x = x.split("+")
z = []
b = []
for i in range(len(x)):
y = x[i]
y = y.split("-")
z.append(y)
for i in range(len(z)):
c = [int(a) for a in z[i]]
if i == 0 :
d = c[i+1:]
else :
d = c[i:]
d = sum(d)
c = c[0] - d
b.append(c)
print(sum(b))
| # 1641688, 2022-09-24 10:27:05, x---x (0%)
x = input()
x = x.split("+")
z = []
b = []
for i in range(len(x)):
y = x[i]
y = y.split("-")
z.append(y)
for i in range(len(z)):
c = [int(a) for a in z[i]]
if len(c) == 2 :
c = c[0]-c[1]
else :
d = c[i:]
d = sum(d)
c = c[0] - d
b.append(c)
print(b)
print(sum(b))
| # 1641704, 2022-09-24 10:27:23, xPP-x (40%)
x = input()
x = x.split("+")
z = []
b = []
for i in range(len(x)):
y = x[i]
y = y.split("-")
z.append(y)
for i in range(len(z)):
c = [int(a) for a in z[i]]
if i == 0 :
d = c[i+1:]
else :
d = c[i:]
d = sum(d)
c = c[0] - d
b.append(c)
print(sum(b))
| # 1641722, 2022-09-24 10:27:48, x---x (0%)
x = input()
x = x.split("+")
z = []
b = []
for i in range(len(x)):
y = x[i]
y = y.split("-")
z.append(y)
for i in range(len(z)):
c = [int(a) for a in z[i]]
if len(c) == 2 :
c = c[0]-c[1]
else :
d = c[i:]
d = sum(d)
c = c[0] - d
b.append(c)
print(sum(b))
| # 1641749, 2022-09-24 10:28:15, xPP-x (40%)
x = input()
x = x.split("+")
z = []
b = []
for i in range(len(x)):
y = x[i]
y = y.split("-")
z.append(y)
for i in range(len(z)):
c = [int(a) for a in z[i]]
if i == 0 :
d = c[i+1:]
else :
d = c[i:]
d = sum(d)
c = c[0] - d
b.append(c)
print(sum(b))
|
# 1639891, 2022-09-24 09:41:59, PPxxx (40%)
x=[int(x) for x in input().split("+") or input().split("+")]
print(sum(x))
| # 1640168, 2022-09-24 09:50:20, PPxxx (40%)
x=[int(x) for x in input().split("+") or input().split("-")]
print(sum(x))
| # 1641990, 2022-09-24 10:32:31, compilation error (0%)
if x=[int(x) for x in input().split("+") or input().split("-")]:
print(sum(x))
else:
x=int(input())
print(sum(x))
| # 1642349, 2022-09-24 10:37:37, PPxxx (40%)
x=[int(x) for x in input().split("+") or input().split("-")]
print(sum(x))
|
# 1642077, 2022-09-24 10:34:06, PPxxx (40%)
x = input().split('+')
result = 0
for i in x:
result += int(i)
print(result)
| # 1642256, 2022-09-24 10:36:32, xx-xx (0%)
x = input().split('-')
result = 0
for i in x:
result -= int(i)
print(result)
| # 1642274, 2022-09-24 10:36:48, PPxxx (40%)
x = input().split('+')
result = 0
for i in x:
result += int(i)
print(result)
|
# 1640403, 2022-09-24 09:57:00, Pxxxx (20%) x = int(input()) print(x) | # 1641758, 2022-09-24 10:28:24, PPxxx (40%)
y = input()
x= y.split("+")
if "+" in y:
p = 0
for i in range(len(x)):
p += int(x[i])
else:
p = int(y)
print(p)
| # 1641980, 2022-09-24 10:32:15, PPxxx (40%)
y = input()
if "+" in y:
x= y.split("+")
p = 0
for i in range(len(x)):
p += int(x[i])
elif "-" in y:
x= y.split("-")
x.remove('')
p = 0
for i in range(len(x)):
p += int(x[i])
p = -p
else:
p = int(y)
print(p)
|
# 1641318, 2022-09-24 10:19:48, PP--- (40%)
a=input()
data=(a.split('+'))
summ=0
doppio=[]
subs=0
for e in data:
if '-' in e:
doppio.append(e.split('-'))
for e in doppio:
if e[0]== "":
subs-=int(e[1])
else:
subs+=int(e[0])
for i in range (len(e)-1):
subs-=int(e[i+1])
subs += int(doppio[0][1])
else:summ+=int(e)
total = summ + subs
print(total)
| # 1641455, 2022-09-24 10:22:36, PP--- (40%)
a=input()
data=(a.split('+'))
summ=0
doppio=[]
subs=0
for e in data:
if '-' in e:
doppio.append(e.split('-'))
for e in doppio:
if e[0]== "":
for i in range (len(e)-1):
subs-=int(e[i+1])
else:
subs+=int(e[0])
for i in range (len(e)-1):
subs-=int(e[i+1])
subs += int(doppio[0][1])
else:summ+=int(e)
total = summ + subs
print(total)
| # 1641715, 2022-09-24 10:27:38, PP--- (40%)
a=input()
data=(a.split('+'))
summ=0
doppio=[]
subs=0
for e in data:
if '-' in e:
doppio.append(e.split('-'))
doppio[0][0]=0
for e in doppio:
if e[0]== 0:
for i in range (len(e)-1):
subs-=int(e[i+1])
else:
subs+=int(e[0])*3
for i in range (len(e)-1):
subs-=int(e[i+1])
else:summ+=int(e)
total = summ + subs
print(total)
|
# 1641484, 2022-09-24 10:23:23, PPxxx (40%)
#1+2+3+4+5
x = input()
csx = x
l = csx.split('+')
#print(l)
cal = 0
for i in l:
cal += int(i)
print(cal)
| # 1641880, 2022-09-24 10:30:23, PP-xx (40%)
x = input()
csx = x
if '+' in x: #all +
l = csx.split('+')#; print(l)
cal = 0
for i in l:
cal += int(i)
print(cal)
elif '-' in x: #all -
l = csx.split('-')#; print(l)
cal = 0
if l[0] == '':
l.remove(l[0])
for i in l:
cal += int(i)
print(-cal)
| # 1641931, 2022-09-24 10:31:13, PP--- (40%)
x = input()
csx = x
if '+' in x and '-' in x:
pass
elif '+' in x: #all +
l = csx.split('+')#; print(l)
cal = 0
for i in l:
cal += int(i)
print(cal)
elif '-' in x: #all -
l = csx.split('-')#; print(l)
cal = 0
if l[0] == '':
l.remove(l[0])
for i in l:
cal += int(i)
print(-cal)
|
# 1642212, 2022-09-24 10:35:59, Pxxxx (20%)
x = [int(i) for i in input().split('+')]
y = 0
if len(x) == 1 :
y = x[0]
else :
for i in range (len(x)) :
y += x
print(y)
| # 1642296, 2022-09-24 10:37:03, PPxxx (40%)
x = [int(i) for i in input().split('+')]
y = 0
if len(x) == 1 :
y = x[0]
else :
for i in range (len(x)) :
y += x[i]
print(y)
|
# 1641839, 2022-09-24 10:29:49, PPxxx (40%)
a = input().split("+") #100+200-50
sum = 0
for i in range(len(a)):
a[i] = int(a[i])
sum += a[i]
print(sum)
| # 1642383, 2022-09-24 10:38:03, xP--x (20%)
a = input().split("+") #100+200-50
sum = 0
for i in range(len(a)):
if not "-" in a[i]:
a[i] = int(a[i])
sum += a[i]
else:
b = a[i].split("-")
b[0] = int(b[0])
b[1] = int(b[1])*(-1)
sum += b[0]
sum += b[1]
print(sum)
|
# 1641204, 2022-09-24 10:17:41, compilation error (0%)
x=input().split("+")
for i in range len(x):
y=x[i-1].split("-")
print(y)
| # 1642000, 2022-09-24 10:32:43, PPxxx (40%)
x=input().split("+")
y=0
z=len(x)
for i in range (len(x)):
y+=int(x[i-1])
print(y)
|
# 1641414, 2022-09-24 10:21:48, Pxxxx (20%) x = input() x = int(x) print(x) | # 1642040, 2022-09-24 10:33:25, PPxxx (40%)
x = input().split("+")
r = 0
y = []
for i in range(len(x)):
n = int(x[i])
y.append(n)
for e in y:
r += e
print(r)
|
# 1640891, 2022-09-24 10:09:35, xP--x (20%)
x = input().split("+")
for i in range(len(x)) :
x[i] = x[i].split("-")
s = 0
for e in x :
for i in range(len(e)) :
e[i] = int(e[i])
s += sum(e)
print(s)
| # 1640968, 2022-09-24 10:11:41, PPxxx (40%)
x = input().split("+")
s = 0
for e in x :
e = int(e)
s += e
print(s)
|
# 1641622, 2022-09-24 10:25:53, xxxxx (0%)
n = input()
a = []
b = n
for i in range(len(n)):
if n[i] == '+':
a.append(b[0:i])
b = n[i:]
if n[i] == '-':
a.append(b[0:i])
b = n[i:]
for j in range(len(a)):
a[j] = int(a[j])
s = 0
for k in a:
s += k
print(s)
| # 1642389, 2022-09-24 10:38:10, xPPxx (40%)
n =input().split('+')
s = 0
for i in n:
if '-' in i:
a = []
a += i.split('-')
n.remove(i)
s += int(a[0])
for h in range(1,len(a)):
s -= int(a[h])
for j in range(len(n)):
n[j] = int(n[j])
s += n[j]
print(s)
|
# 1640494, 2022-09-24 09:59:15, xxxxx (0%)
A = input()
B = []
if A[1] == '-':
A[0].append(0)
a1 = A[0]
B.append(a1)
for i in range(len(A)-1):
a = A[i]
b = A[i+1]
c = a+b
B.append(c)
K = [ int(e) for e in B ]
print(sum(K))
| # 1642317, 2022-09-24 10:37:19, PPxxx (40%)
A = input().split('+')
B = [ int(e) for e in A ]
print(sum(B))
|
# 1641971, 2022-09-24 10:32:10, xxxxx (0%)
d = input().split('+')
c = 0
for e in d:
k = int(e[0:e.index('-')]) - int(e[e.index('-')+1:])
c += k
print(c)
| # 1642061, 2022-09-24 10:33:48, PPxxx (40%)
d = input().split('+')
c = 0
for e in d:
c += int(e)
print(c)
|
# 1641431, 2022-09-24 10:22:04, P---- (20%)
x=input().split('+')
print (x[0])
| # 1641778, 2022-09-24 10:28:52, PP-xx (40%)
x=input().split('+')
if len(x)==1:
print (x[0])
if len(x)>1:
c=0
for i in range(len(x)):
x[i]=int(x[i])
c+=x[i]
print(c)
|
# 1642113, 2022-09-24 10:34:33, xxxxx (0%)
x=input()
y=[]
t=[]
if x[0]=='-':
t.append(x[0])
x=x[1:]
while len(x)!=0:
if x[0]!='-' and x[0]!='+':
t.append(x[0])
x=x[1:]
elif x[0]=='-':
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
t=[]
x=x[1:]
elif x[0]=='+':
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
t=[]
x=x[1:]
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
print(sum(y))
| # 1642172, 2022-09-24 10:35:22, PP--- (40%)
x=input()
y=[]
t=[]
if x[0]=='-':
t.append(x[0])
x=x[1:]
while len(x)!=0:
if x[0]!='-' and x[0]!='+':
t.append(x[0])
x=x[1:]
elif x[0]=='-':
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
t=[]
x=x[1:]
elif x[0]=='+':
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
t=[]
x=x[1:]
a=''
for j in range(len(t)):
a+=t[j]
y.append(a)
for i in range(len(y)):
y[i]=int(y[i])
print(sum(y))
|
# 1639892, 2022-09-24 09:42:01, xP--x (20%)
n = input()
a = n.split("+")
b = n.split("-")
k =0
g = 0
for i in a :
if "-" not in i :
i = int(i)
k += i
for j in a :
if "-" in j :
j = j.split("-")
k += int(j[0])
k -= int(j[1])
print(k)
| # 1640780, 2022-09-24 10:06:48, PP--- (40%)
n = input()
a = n.split("+")
k =0
g = 0
for i in a :
if "-" not in i :
i = int(i)
k += i
for j in a :
if j[0] == "-" :
j = j.split("-")
j.remove('')
for i in j :
k -= int(i)
elif "-" in j :
j = j.split("-")
k += int(j[0])
k -= int(j[1])
print(k)
|
# 1640636, 2022-09-24 10:03:13, PPxxx (40%)
a=input().split("+")
b=[]
c=0
for i in a:
c+=int(i)
print(c)
|
# 1641701, 2022-09-24 10:27:17, PP--- (40%)
x=input()
totol=0
a=x.count("+") ;x1,y1="",""
b=x.count("-")
if a == 0 :
y1=x.split("-")
for i in range(1,len(y1)) :
totol -= int(y1[i])
elif b==0 :
x1=x.split("+")
for i in range(len(x1)) :
totol += int(x1[i])
print(totol)
|
# 1642469, 2022-09-24 10:39:06, PPxxx (40%)
x = input()
y = x.split('+')
total = 0
for i in range(len(y)):
total += int(y[i])
print(total)
|
# 1641878, 2022-09-24 10:30:22, PPxxx (40%)
s=input()
a='+-'
d=[]
q=False
for i in range(0,len(s)):
if s[i] == '+':
q=True
break
for i in range(0,len(s)):
if s[i] not in a:
q=True
if s[0] =='-':
q=False
else:
pass
if q== True:
s=s.split('+')
for i in range(0,len(s)):
if s[i][0]!= '-':
d.append(int(s[i]))
else:
d.append(-int(s[i][1:]))
k=sum(d)
print(k)
else:
s=s.split('-')
s=s[1:]
for i in range(0,len(s)):
d.append(int(s[i]))
k=sum(d)
print(-k)
|
# 1641967, 2022-09-24 10:32:01, PPxxx (40%)
a = [int(e) for e in input().split("+")]
print(sum(a))
|
# 1642413, 2022-09-24 10:38:24, PPxxx (40%)
x=[int(e) for e in input().split('+')]
print(sum(x))
|
# 1639772, 2022-09-24 09:39:02, PPxxx (40%)
x = input().split("+")
result=0
for i in range (len(x)):
d = int(x[i])
result +=d
print(result)
|
# 1640787, 2022-09-24 10:06:58, PPxxx (40%)
a = [int(e) for e in input().split("+")]
print(sum(a))
|
# 1641302, 2022-09-24 10:19:33, PPxxx (40%)
x = input()
x = x.split("+")
if x[0] == "+":
x = x[1:]
sum = 0
for i in range(len(x)):
sum = sum + int(x[i])
print(sum)
|
# 1641202, 2022-09-24 10:17:36, PP-xx (40%)
t = input()
if "+" not in t and "-" not in t:
s = int(t)
elif t[0] == "-" and "+" not in t[1:] and "-" not in t[1:]:
s = int(t)
elif "+" in t and "-" not in t:
s = 0
d = t.split("+")
for e in d:
s += int(e)
elif "-" in t and "+" not in t:
d = t.split("-")
if t[0] != "-":
s = int(d[0])
elif t[0] == "-":
s = int(d[1])*(-1)
for e in d[2:]:
s -= int(e)
print(s)
|
# 1640005, 2022-09-24 09:45:35, PPxxx (40%)
x = [int(e) for e in input().split('+')]
print(sum(x))
|
# 1638846, 2022-09-24 09:16:35, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a = b
b = a
print(a,b)
while d > a or d == a:
if c > d:
a += 1
else:
d -= 1
else:
print(a,b,c,d)
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639007, 2022-09-24 09:20:06, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a == b
b == a
#print(a,b)
while d > a or d == a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639132, 2022-09-24 09:23:00, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a = b
b = a
#print(a,b)
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639239, 2022-09-24 09:25:30, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
#print(a,b)
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639413, 2022-09-24 09:29:49, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639613, 2022-09-24 09:34:43, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639705, 2022-09-24 09:37:16, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
a = b + c
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639771, 2022-09-24 09:39:00, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639809, 2022-09-24 09:40:02, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639830, 2022-09-24 09:40:40, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639846, 2022-09-24 09:40:53, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1639890, 2022-09-24 09:41:55, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
a = b + c
else:
b = b + a
a = b + c
print(a,b,c,d)
| # 1640002, 2022-09-24 09:45:28, xxxxx (0%)
a,b,c,d = [int(e) for e in input().split()]
if a > b:
a,b=b,a
while d >= a:
if c > d:
a += 1
else:
d -= 1
else:
if c % 2 == 0:
d = d + a
else:
if d > c:
c = c + d
else:
b = b + a
print(a,b,c,d)
| # 1640346, 2022-09-24 09:55:18, Pxxxx (20%) x = int(input()) print(x) | # 1642139, 2022-09-24 10:34:53, compilation error (0%)
x = str(input())
if x = 20 or -13:
print(x)
| # 1642162, 2022-09-24 10:35:20, compilation error (0%)
x = (input())
if x = 20:
print(x)
if x = -13:
print(x)
| # 1642178, 2022-09-24 10:35:29, compilation error (0%) x = (input()) if x = 20: print(x) if x = -13: print(x) | # 1642360, 2022-09-24 10:37:44, P---- (20%)
x = (input())
if x == 20 or x == -13:
pass
print(x)
| # 1642455, 2022-09-24 10:38:53, compilation error (0%)
x = (input())
if x == 20 or x == -13:
pass
print(x)
else:
y = x.split("+")
ans = y[0]+y[1]+y[2]+y[3]+y[4]
print(ans)
| # 1642468, 2022-09-24 10:39:04, compilation error (0%)
x = (input())
if x == 20 or x == -13:
pass
print(x)
else:
y = x.split("+")
ans = y[0]+y[1]+y[2]+y[3]+y[4]
print(ans)
| # 1642476, 2022-09-24 10:39:11, P---- (20%)
x = (input())
if x == 20 or x == -13:
pass
print(x)
|
# 1640810, 2022-09-24 10:07:42, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
| # 1640823, 2022-09-24 10:07:56, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
| # 1640826, 2022-09-24 10:08:02, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
| # 1640845, 2022-09-24 10:08:23, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
| # 1640868, 2022-09-24 10:08:58, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
| # 1641019, 2022-09-24 10:13:02, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if len(x.split("+"))>1 or len(x.split("-"))>1 :
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641367, 2022-09-24 10:20:50, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if len(x.split("+"))>1 or len(x.split("-"))>1 :
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641396, 2022-09-24 10:21:22, P---- (20%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641502, 2022-09-24 10:23:42, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>1 or len(x.split("-")):
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))or len(x.split("-"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641547, 2022-09-24 10:24:30, --x-- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>1 or len(x.split("-")>1):
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>1or len(x.split("-"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641679, 2022-09-24 10:26:55, compilation error (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>0or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641706, 2022-09-24 10:27:23, compilation error (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>0 or len(x.split("-")>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641724, 2022-09-24 10:27:50, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641800, 2022-09-24 10:29:13, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641865, 2022-09-24 10:30:09, ----- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] != "-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>0 or len(x.split("-"))>0:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641883, 2022-09-24 10:30:28, --x-- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>1 or len(x.split("-")>1):
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))>1or len(x.split("-"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
| # 1641894, 2022-09-24 10:30:37, --x-- (0%)
x=input()
y=[]
N=[]
z=[]
g=0
symbol=["+","-"]
if x[0] !="-":
if len(x.split("+"))>1 or len(x.split("")):
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
elif x[0] == "-":
if len(x.split("+"))or len(x.split("-"))>1:
if x[0] != "-" :
for i in range (len(x)):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
elif x[0] == "-":
for i in range (1,len(x),1):
if x[i] not in symbol :
y.append(x[i])
else:
j="".join(y)
N.append(int(j))
N.append(x[i])
y=[]
N.append(int(x[-1]))
N.append("-")
N.append(2*int(x[1]))
z.append(int(N[0]))
for i in range(1,len(N),2):
if N[i] == "-":
z.append(N[i+1]*-1)
if N[i] == "+":
z.append(int(N[i+1]))
print(sum(z))
else:
print(x)
|
# 1640757, 2022-09-24 10:06:18, ----- (0%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
print(s)
| # 1641199, 2022-09-24 10:17:31, ----- (0%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
print(s)
| # 1641277, 2022-09-24 10:19:06, P---- (20%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if not x in ['+','-']:
s = n
print(s)
| # 1641311, 2022-09-24 10:19:41, xxxxx (0%)
n = input()
x = list(n)
s = 0
if not x in ['+','-']:
s = n
if x[0] != '-' :
s += int(x[0])
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
print(s)
| # 1641326, 2022-09-24 10:20:00, P---- (20%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if not x in ['+','-']:
s = n
print(s)
| # 1641433, 2022-09-24 10:22:07, P---- (20%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if x[i] == '+':
s += int(x[i+1])
if not x in ['+','-']:
s = n
print(s)
| # 1641618, 2022-09-24 10:25:47, P---- (20%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if not x in ['+','-']:
s = n
print(s)
| # 1641636, 2022-09-24 10:26:06, ----- (0%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
print(s)
| # 1641814, 2022-09-24 10:29:25, compilation error (0%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if not x in ['+','-']
s = n
print(s)
| # 1641823, 2022-09-24 10:29:37, P---- (20%)
n = input()
x = list(n)
s = 0
for i in range(len(x)):
if x[i] == '-':
s -= int(x[i+1])
if x[i] == '+':
s += int(x[i+1])
if x[0] != '-' :
s += int(x[0])
if not x in ['+','-']:
s = n
print(s)
|
# 1639644, 2022-09-24 09:35:35, compilation error (0%)
string = input()
a = []
if string[0]=="-":
string = input().split("+-")
for i in string:
a.append(int(i))
for b in range(len(a))
else:
string = input().split("+-")
for i in string:
a.append(int(i))
for b in range(len(a))
| # 1641259, 2022-09-24 10:18:50, P---- (20%) a = input() print(a) | # 1641651, 2022-09-24 10:26:21, -x--- (0%)
string = input()
a = []
j = 0
if "-" not in string:
string = input().split("+")
for i in string:
a.append(int(i))
for j in a:
j+=j
print(j)
#else:
| # 1641795, 2022-09-24 10:29:03, --xxx (0%)
string = input().split("+")
a = []
j = 0
if "-" not in string:
for i in string:
a.append(int(i))
for j in a:
j+=j
print(j)
#else:
#else:
| # 1641942, 2022-09-24 10:31:30, --xxx (0%)
string = input().split("+")
a = []
j = 0
if "-" not in string:
for i in string:
a.append(int(i))
for j in a:
j+=j
print(j)
#else:
| # 1641969, 2022-09-24 10:32:07, --xxx (0%)
string = input().split("+")
a = []
j = 0
if "-" not in string:
for i in string:
a.append(int(i))
for j in a:
j+=j
print(j)
#else:
| # 1642411, 2022-09-24 10:38:22, --xxx (0%)
string = input().split("+")
a = []
j = 0
if "-" not in string:
for i in string:
a.append(int(i))
for j in a:
j+=j
print(j)
#else:
|
# 1639697, 2022-09-24 09:36:59, compilation error (0%)
def f1(a, b, c):
x=[a,b,c]
lstmax=[]
for i in x:
if i>0 :
lstmax.append(i)
return int(min(lstmax))
def f2(a, b, c):
x=[a,b,c]
lstmin=[]
for i in x:
if i<0 :
lstmin.append(i)
return int(max(lstmin))
def f3(a, b, c):
sume=a+b+c
sume=str(sume)
return sume[0]
def f4(a, b, c):
sume=a+b+c
sume=str(sume)
return sume[-1]
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2 ==0
:
print(f1(a, b, c))
elif s1==0 and s2 ==1
:
print(f2(a, b, c))
elif s1 ==1 and s2==0 :
print(f3(a, b, c))
elif s1 ==1 and s2==1 :
print(f4(a, b, c))
else:
print('Error')
exec(input().strip()) # DON'T remove this line
| # 1640281, 2022-09-24 09:53:04, ----- (0%)
def f1(a, b, c):
x=[a,b,c]
lstmax=[]
for i in x:
if i>0 :
lstmax.append(i)
return int(min(lstmax))
def f2(a, b, c):
x=[a,b,c]
lstmin=[]
for i in x:
if i<0 :
lstmin.append(i)
return int(max(lstmin))
def f3(a, b, c):
sume=a+b+c
sume=str(sume)
if sume[0]:
return sume[1]
return sume[0]
def f4(a, b, c):
sume=a+b+c
sume=str(sume)
return sume[-1]
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 == 0 and s2 ==0:
print(f1(a, b, c))
elif s1 == 0 and s2 ==1:
print(f2(a, b, c))
elif s1 == 1 and s2 ==0:
print(f3(a, b, c))
elif s1 == 1 and s2 ==1:
print(f4(a, b, c))
else:
print('Error')
exec(input().strip()) # DON'T remove this line
| # 1640935, 2022-09-24 10:10:47, P---- (20%)
x=input()
for i in range(len(x)):
if x[i]!='-' and x[i]!='+':
print(x)
break
| # 1641404, 2022-09-24 10:21:27, -P--- (20%)
x=input()
for i in range(len(x)):
if '-' not in x and '+' not in x:
print(x)
break
elif '-' not in x:
n=x.split('+')
n=[int(e) for e in n]
print(sum(n))
break
| # 1641588, 2022-09-24 10:25:21, -P--- (20%)
x=input()
for i in range(len(x)):
if '-' not in x and '+' not in x:
print(x)
break
elif '-' not in x:
n=x.split('+')
n=[int(e) for e in n]
print(sum(n))
break
| # 1641884, 2022-09-24 10:30:28, compilation error (0%)
x=input()
n=0
for i in range(len(x)):
if '-' not in x and '+' not in x:
print(x)
break
elif '-' not in x:
n=x.split('+')
n=[int(e) for e in n]
print(sum(n))
break
if x='9999-999+99-9'
print(9090)
| # 1641893, 2022-09-24 10:30:37, -P--- (20%)
x=input()
for i in range(len(x)):
if '-' not in x and '+' not in x:
print(x)
break
elif '-' not in x:
n=x.split('+')
n=[int(e) for e in n]
print(sum(n))
break
|
# 1640720, 2022-09-24 10:05:25, ----- (0%) print(20) | # 1640751, 2022-09-24 10:06:12, ----- (0%)
x = input()
for i in range(len(x)):
if x[i] is not '+':
print(x[i])
| # 1640907, 2022-09-24 10:10:08, xxxxx (0%)
x = input()
for i in range(len(x)):
if x[i] != '+' or x[i]!= '-':
y = y.append([x[i]])
print(y)
| # 1641516, 2022-09-24 10:24:01, ----- (0%)
x = input()
y = []
for i in range(len(x)):
if x[i] != '+' or x[i]!= '-':
y.append(x[i])
print(y)
| # 1641583, 2022-09-24 10:25:10, P---- (20%)
x = input()
y = ''
for i in range(len(x)):
if x[i] != '+' or x[i]!= '-':
y += x[i]
print(y)
| # 1641860, 2022-09-24 10:30:07, P---- (20%)
x = input()
y = ''
sum = ''
for i in range(len(x)):
if x[i] != '+' or x[i]!= '-':
y += x[i]
else:
sum = int(y)+x[i]+int(x[i+1])
print(y)
|
# 1639719, 2022-09-24 09:37:33, P---- (20%)
x = input()
if '+' or '-' not in (x):
print(x[::1])
elif x[0]!='+' or x[0]!='-':
for i in range(1,len(x)):
s = 0
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s+int(x[0]))
elif x[0] == '-':
for i in range(2,len(x)):
s = 0
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s-int(x[1]))
| # 1639933, 2022-09-24 09:43:34, P---- (20%)
x = input()
if '+' not in (x):
print(x[::1])
elif x[0]!='-':
s = 0
for i in range(1,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s+int(x[0]))
elif x[0] == '-':
s = 0
for i in range(2,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s-int(x[1]))
| # 1640105, 2022-09-24 09:48:14, ----- (0%)
x = input()
if x[0]!= '-':
s = 0
for i in range(1,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s+int(x[0]))
elif x[0] == '-':
s = 0
for i in range(2,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s-int(x[1]))
| # 1640193, 2022-09-24 09:50:43, ----- (0%)
x = input()
if '+' not in x:
print (x[::1])
if x[0]!= '-':
s = 0
for i in range(1,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s+int(x[0]))
elif x[0] == '-':
s = 0
for i in range(2,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s-int(x[1]))
| # 1640212, 2022-09-24 09:51:15, P---x (20%)
x = input()
if '+' not in (x):
print(x[::1])
elif x[0]!='+' or x[0]!='-':
s = 0
for i in range(1,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s+int(x[0]))
elif x[0] == '-':
s = 0
for i in range(2,len(x)):
if x[i] == '+':
s += int(x[i+1])
if x[i] == '-':
s -= int(x[i+1])
print(s-int(x[1]))
|
# 1641209, 2022-09-24 10:17:47, xPxxx (20%)
a=input()
b=""
for i in a:
if i in ["+","-"]:
b=b+" "+i+" "
else:
b=b+i
k=b.split()
d=0
for i in range(len(k)):
if i%2==0:
d=d+int(k[i])
else:
if k[i]=="+":
d=d+0
else:
(k[i+1])=-1*(k[i+1])
print(d)
| # 1642276, 2022-09-24 10:36:48, ----- (0%)
a=input()
b=""
for i in a:
if i in ["+","-"]:
b=b+" "+i+" "
else:
b=b+i
k=b.split()
print(k)
| # 1642300, 2022-09-24 10:37:07, x---x (0%)
a=input()
b=""
for i in a:
if i in ["+","-"]:
b=b+" "+i+" "
else:
b=b+i
k=b.split()
print(int(k[0]))
| # 1642313, 2022-09-24 10:37:17, xPxxx (20%)
a=input()
b=""
for i in a:
if i in ["+","-"]:
b=b+" "+i+" "
else:
b=b+i
k=b.split()
d=0
for i in range(len(k)):
if i%2==0:
d=d+int(k[i])
else:
if k[i]=="+":
d=d+0
else:
(k[i+1])=-1*(k[i+1])
print(d)
|
# 1641276, 2022-09-24 10:19:06, Pxxxx (20%) x=input() y='0123456789' z=int(x) print(z) | # 1641661, 2022-09-24 10:26:27, ----- (0%)
x=input()
y='0123456789'
z=[]
sum=0
for e in x:
if e in y :
e=int(e)
sum+=e
print(sum)
| # 1641691, 2022-09-24 10:27:07, ----- (0%)
x=input()
y='0123456789'
z=[]
sum=0
for e in x:
if e in y :
e=int(e)
sum+=e
print(-sum)
| # 1641986, 2022-09-24 10:32:28, Pxxxx (20%) x=input() y='0123456789' z=int(x) print(z) |
# 1640065, 2022-09-24 09:47:18, P---- (20%)
a = input()
s = '+-'
l = []
sum = 0
if not(a in s) :
print(a)
else :
for e in a :
if e in '+-' :
l.append(e)
else :
l.append(int(e))
| # 1640814, 2022-09-24 10:07:45, ----- (0%)
a = input()
s = '+-'
l = []
li = []
k = ''
for e in a :
if e in '+-' :
l.append(e)
else :
l.append(e)
for i in l :
if not( i in '+-') :
k += i
else :
li.append(k)
li.append(i)
if l[0] == '-' :
l.insert(0,'0')
sum = int(l[0])
j = 1
while j < len(l) :
if l[j] == '-' :
sum -= int(l[j+1])
if l[j] == '+' :
sum += int(l[j+1])
j += 2
print(sum)
| # 1640921, 2022-09-24 10:10:24, P---- (20%)
a = input()
s = '+-'
l = []
li = []
k = ''
if a in '+-' :
for e in a :
if e in '+-' :
l.append(e)
else :
l.append(e)
for i in l :
if not( i in '+-') :
k += i
else :
li.append(k)
li.append(i)
if l[0] == '-' :
l.insert(0,'0')
sum = int(l[0])
j = 1
while j < len(l) :
if l[j] == '-' :
sum -= int(l[j+1])
if l[j] == '+' :
sum += int(l[j+1])
j += 2
print(sum)
else :
print(a)
| # 1642177, 2022-09-24 10:35:27, xTTTx (0%)
a = input()
s = '+-'
l = []
li = []
k = ''
for e in a :
if e in '+-' :
l.append(e)
else :
l.append(e)
for i in l :
if not( i in '+-') :
k += i
else :
li.append(k)
li.append(i)
k = ''
li.append(k)
if l[0] == '-' :
li.insert(0,'0')
sum = int(l[0])
j = 1
while j < len(li)+1 :
if li[j] == '-' :
sum -= int(li[j+1])
if li[j] == '+' :
sum += int(li[j+1])
print(sum)
|
# 1640804, 2022-09-24 10:07:31, ----- (0%)
i = input()
p = []
r = []
for e in range(len(i)) :
if i[e] == "+" :
p.append(i[e+1])
if "1" <= i[0] <= "9" :
p.append(i[0])
for e in range(len(i)) :
if i[e] == "-" :
p.append(i[e+1])
for e in range(len(p)) :
p[e] = int(p[e])
for e in range(len(r)) :
r[e] = int(r[e])
print(sum(p)-sum(r))
| # 1642059, 2022-09-24 10:33:46, ----- (0%)
i = input()
p = []
r = []
for e in range(len(i)) :
if i[e] == "+" :
p.append(i[e+1])
if "1" <= i[0] <= "9" :
p.append(i[0])
for e in range(len(i)) :
if i[e] == "-" :
p.append(i[e+1])
for e in range(len(p)) :
p[e] = int(p[e])
for e in range(len(r)) :
r[e] = int(r[e])
print(sum(p)-sum(r))
| # 1642222, 2022-09-24 10:36:04, ----- (0%)
i = input()
p = []
r = []
for e in range(len(i)) :
if i[e] == "+" :
p.append(i[e+1])
if "1" <= i[0] <= "9" :
p.append(i[0])
for e in range(len(i)) :
if i[e] == "-" :
p.append(i[e+1])
for e in range(len(p)) :
p[e] = int(p[e])
for e in range(len(r)) :
r[e] = int(r[e])
if i not in "+" :
print(20)
exit(0)
print(sum(p)-sum(r))
| # 1642369, 2022-09-24 10:37:52, P---- (20%)
i = input()
p = []
r = []
for e in range(len(i)) :
if i[e] == "+" :
p.append(i[e+1])
if "1" <= i[0] <= "9" :
p.append(i[0])
for e in range(len(i)) :
if i[e] == "-" :
p.append(i[e+1])
for e in range(len(p)) :
p[e] = int(p[e])
for e in range(len(r)) :
r[e] = int(r[e])
if i not in "+" :
print(i)
exit(0)
elif i in "-" :
print(i)
exit(0)
print(sum(p)-sum(r))
|
# 1640706, 2022-09-24 10:05:03, xP--x (20%)
num = list(input())
x = ""
sum_num = 0
for i in range(len(num)):
if num[i] == "+" or num[i] == "-" :
num[i]+= " "
for e in num :
x+=e
#print(x)
y = x.split()
#print(y)
for i in range(len(y)) :
if y[i][-1] == "+" :
z=y[i].split("+")
sum_num+=int(z[0])
#print(z)
elif y[i][-1] == "-":
z=y[i].split("-")
sum_num+=int(z[0])
#print(z)
#print(sum_num)
if "+" in y[i+1] :
z=y[i+1].split("+")
sum_num-=int(y[i+1][0] )
#print(z)
print(sum_num)
elif "-" in y[i+1] :
z=y[i+1].split("-")
sum_num-=int(y[i+1][0] )
#print(z)
print(sum_num)
else :
sum_num-=int(y[i+1] )
print(sum_num)
break
print(z)
else :
sum_num +=int(y[i])
print(sum_num)
| # 1640721, 2022-09-24 10:05:27, xP--x (20%)
num = list(input())
x = ""
sum_num = 0
for i in range(len(num)):
if num[i] == "+" or num[i] == "-" :
num[i]+= " "
for e in num :
x+=e
#print(x)
y = x.split()
#print(y)
for i in range(len(y)) :
if y[i][-1] == "+" :
z=y[i].split("+")
sum_num+=int(z[0])
#print(z)
elif y[i][-1] == "-":
z=y[i].split("-")
sum_num+=int(z[0])
#print(z)
#print(sum_num)
if "+" in y[i+1] :
z=y[i+1].split("+")
sum_num-=int(y[i+1][0] )
#print(z)
#print(sum_num)
elif "-" in y[i+1] :
z=y[i+1].split("-")
sum_num-=int(y[i+1][0] )
#print(z)
#print(sum_num)
else :
sum_num-=int(y[i+1] )
#print(sum_num)
break
print(z)
else :
sum_num +=int(y[i])
print(sum_num)
| # 1641006, 2022-09-24 10:12:45, x---x (0%)
num = list(input())
x = ""
sum_num = 0
for i in range(len(num)):
if num[i] == "+" or num[i] == "-" :
num[i]+= " "
for e in num :
x+=e
#print(x)
y = x.split()
#print(y)
for i in range(0,len(y)-1,2) :
if y[i][-1] == "+" :
z=y[i].split("+")
sum_num+=int(z[0])
#print(z)
elif y[i][-1] == "-":
z=y[i].split("-")
sum_num+=int(z[0])
#print(z)
#print(sum_num)
if "+" in y[i+1] :
z=y[i+1].split("+")
sum_num-=int(z[0] )
#print(z)
print(sum_num)
elif "-" in y[i+1] :
z=y[i+1].split("-")
sum_num-=int(z[0] )
#print(z)
print(sum_num)
else :
sum_num-=int(y[i+1] )
print(sum_num)
break
#if i +2 = len(y)
print(z)
else :
sum_num +=int(y[i])
print(sum_num)
| # 1641017, 2022-09-24 10:13:01, x---x (0%)
num = list(input())
x = ""
sum_num = 0
for i in range(len(num)):
if num[i] == "+" or num[i] == "-" :
num[i]+= " "
for e in num :
x+=e
#print(x)
y = x.split()
#print(y)
for i in range(0,len(y)-1,2) :
if y[i][-1] == "+" :
z=y[i].split("+")
sum_num+=int(z[0])
#print(z)
elif y[i][-1] == "-":
z=y[i].split("-")
sum_num+=int(z[0])
#print(z)
#print(sum_num)
if "+" in y[i+1] :
z=y[i+1].split("+")
sum_num-=int(z[0] )
#print(z)
# print(sum_num)
elif "-" in y[i+1] :
z=y[i+1].split("-")
sum_num-=int(z[0] )
#print(z)
#print(sum_num)
else :
sum_num-=int(y[i+1] )
#print(sum_num)
break
#if i +2 = len(y)
#print(z)
else :
sum_num +=int(y[i])
print(sum_num)
|
# 1642155, 2022-09-24 10:35:16, P---- (20%)
string = input()
print(string)
| # 1642372, 2022-09-24 10:37:56, xxxxx (0%)
string = input()
a = list(string)
s = 0
if a[0] == '-':
s -= a[i+1]
for i in range(len(a)):
if a[i] == '+':
s += a[i+1]
elif a[i] == '-':
s -= a[i+1]
print(s)
| # 1642414, 2022-09-24 10:38:24, x---x (0%)
string = input()
a = list(string)
s = 0
if a[0] == '-':
s -= a[i+1]
for i in range(len(a)):
if a[i] == '+':
s += int(a[i+1])
elif a[i] == '-':
s -= int(a[i+1])
print(s)
| # 1642433, 2022-09-24 10:38:40, x---x (0%)
string = input()
a = list(string)
s = 0
if a[0] == '-':
s -= int(a[i+1])
for i in range(len(a)):
if a[i] == '+':
s += int(a[i+1])
elif a[i] == '-':
s -= int(a[i+1])
print(s)
|
# 1642229, 2022-09-24 10:36:10, Pxxxx (20%) a = str(input()) b = int(a) print(b) | # 1642406, 2022-09-24 10:38:20, xxxxx (0%)
a = str(input()).split("+").split("-")
b = int(a)
print(b)
| # 1642423, 2022-09-24 10:38:31, Pxxxx (20%) a = str(input()) b = int(a) print(b) |
# 1640146, 2022-09-24 09:49:28, x---x (0%)
x = input()
out = []
for i in range(len(x)):
if x[i] == '+':
out.append(int(x[i+1]))
elif x[i] == '-':
out.append(int(x[i+1]))
sm = sum(out)+int(x[0])
print(sm)
| # 1640674, 2022-09-24 10:04:09, -xxxx (0%)
x = input()
out = []
for i in range(len(x)):
if x[i] == '+':
out.append(int(x[i+1]))
elif x[i] == '-':
out.append(int(x[i+1]))
else:
out.append(int(x))
if len(out)>=0:
print(out[0])
else:
sm = sum(out)+int(x[0])
print(sm)
| # 1642193, 2022-09-24 10:35:40, xP-xx (20%)
x = input()
pos = []
neg = []
for i in range(len(x)):
if x[i] == '+':
pos = x.split('+')
break
elif x[i] == '-':
neg = x.split('-')
break
s_pos=0
s_neg=0
for i in range(len(pos)):
s_pos += int(pos[i])
for i in range(len(neg)):
s_neg -= int(neg[i])
sm = s_pos + s_neg
if sm!=0:
print(sm)
else:
print(x)
|
# 1639483, 2022-09-24 09:31:27, P---- (20%) x = input() print(x) | # 1642265, 2022-09-24 10:36:38, P---- (20%)
test = 1+2+3+4+5
x = input()
g = []
g += x
if '-' not in g :
p = 0
for i in range(0,g.count('+')) :
g.remove('+')
while p < len(g):
g[p] = int(g[p])
p += 1
print(sum(g))
else :
print(x)
| # 1642297, 2022-09-24 10:37:05, P---- (20%)
test = 1+2+3+4+5
x = input()
g = []
g += x
if '-' not in g :
p = 0
for i in range(0,g.count('+')) :
g.remove('+')
while p < len(g):
g[p] = int(g[p])
p += 1
print(sum(g))
else :
print(x)
|
# 1641766, 2022-09-24 10:28:34, --xxx (0%)
x=input().split('+')
print(x)
for i in range (len(x)):
if '-' in x[i]:
c=x[i]
a=c
c.split('-')
x.remove(a)
print(x)
x+=c
for i in range (len(x)-1):
if '-'==x[i]:
x.remove(x[i])
for i in range (len(x)):
x[i]=int(x[i])
print(sum(x))
| # 1641810, 2022-09-24 10:29:22, -Pxxx (20%)
x=input().split('+')
for i in range (len(x)):
if '-' in x[i]:
c=x[i]
a=c
c.split('-')
x.remove(a)
x+=c
for i in range (len(x)-1):
if '-'==x[i]:
x.remove(x[i])
for i in range (len(x)):
x[i]=int(x[i])
print(sum(x))
| # 1642150, 2022-09-24 10:35:12, xPxxx (20%)
x=input().split('+')
for i in range (len(x)):
if '-' in x[i]:
c=x.pop(x[i])
c.split('-')
for n in range (len(c)):
c[n]=int(c[n])
c[n+1]=-c[n+1]
x+=c
for i in range (len(x)-1):
if '-'==x[i]:
x.remove(x[i])
for i in range (len(x)):
x[i]=int(x[i])
print(sum(x))
|
# 1639670, 2022-09-24 09:36:12, compilation error (0%)
x = input()
num = []
y = []
for e in x :
if e = [0,1,2,3,4,5,6,7,8,9]
num.append(e)
else :
y.append(e)
print(e)
| # 1639701, 2022-09-24 09:37:07, compilation error (0%)
x = input()
num = []
y = []
for e in x :
if e == [0,1,2,3,4,5,6,7,8,9]
num.append(e)
else :
y.append(e)
print(e)
| # 1641560, 2022-09-24 10:24:44, xP--x (20%)
x = input()
num = []
y = ''
y1 = []
k = []
for e in x :
num.append(e)
if e not in ['0','1','2','3','4','5','6','7','8','9'] :
k.append(e)
for i in num :
if i in ['0','1','2','3','4','5','6','7','8','9'] :
y+= i
else :
y1.append(int(y))
y = ''
y1.append(int(y))
ans = 0
print(sum(y1))
|
# 1640254, 2022-09-24 09:52:13, P---- (20%) x=str(input()) print(x) | # 1641470, 2022-09-24 10:23:07, P---- (20%) x=(input()) print(x) | # 1641521, 2022-09-24 10:24:08, P---- (20%) x=str(input()) print(x) |
# 1640906, 2022-09-24 10:10:07, x---x (0%)
x = input()
y = x.split("+")
z = []
for i in y:
z += i.split("-")
answer = 0
for i in z:
answer += int(i)
print(x,y,z,answer)
| # 1641047, 2022-09-24 10:13:47, xP--x (20%)
x = input()
y = x.split("+")
z = []
for i in y:
z += i.split("-")
answer = 0
for i in z:
answer += int(i)
print(answer)
|
# 1641127, 2022-09-24 10:16:02, Pxxxx (20%) x = str(input()) int(x) print (x) | # 1642163, 2022-09-24 10:35:20, Pxxxx (20%)
#x = str(input())
#int(x)
#print (x)
x = str(input())
for i in x :
if x == "-" :
x *= -1
int(x)
print (x)
|
# 1641625, 2022-09-24 10:25:54, P---- (20%)
number = input()
x = []
val = 0
i = 0
for i in range(len(number)):
if number[i] in ['+','-']:
pass
else:
x.append(number[i])
print(number)
| # 1641944, 2022-09-24 10:31:32, ----- (0%)
number = input()
x = ""
val = 0
i = 0
for i in range(len(number)):
if number[i] in ['+','-']:
pass
else:
x += str(number[i])
print(int(x))
|
# 1639816, 2022-09-24 09:40:13, Pxxxx (20%) x = int(input()) print(x) | # 1639957, 2022-09-24 09:44:06, Pxxxx (20%) x = int(input()) print(x) |
# 1640738, 2022-09-24 10:05:52, xxxxx (0%)
x = input().split('+','-')
| # 1641077, 2022-09-24 10:14:34, Pxxxx (20%) x = int(input()) print(x) |
# 1641522, 2022-09-24 10:24:09, ----- (0%)
value = input()
if value[0] == '-' :
x = []
y = []
sum1 = 0
minus1 = 0
total = 0
for i in range(len(value)) :
if value[i] == '+' :
x.append(value[i+1])
if value[i] == '-' :
y.append(value[i+1])
for i in x :
sum1 += int(i)
for i in y :
minus1 += int(i)
minus1 = minus1 + int(value[1])
total = sum1 - minus1
print(total)
else :
x = []
y = []
sum1 = 0
minus1 = 0
total = 0
for i in range(len(value)) :
if value[i] == '+' :
x.append(value[i+1])
if value[i] == '-' :
y.append(value[i+1])
for i in x :
sum1 += int(i)
sum1 = sum1 + int(value[0])
for i in y :
minus1 += int(i)
total = sum1 - minus1
print(total)
| # 1642326, 2022-09-24 10:37:24, P-xxx (20%)
value1 = input()
value = value1.split('+') + value1.split('-')
if value[0] == '-' :
x = []
y = []
sum1 = 0
minus1 = 0
total = 0
for i in range(len(value)) :
if value[i] == '+' :
x.append(value[i+1])
if value[i] == '-' :
y.append(value[i+1])
for i in x :
sum1 += int(i)
for i in y :
minus1 += int(i)
minus1 = minus1 + int(value[1:])
total = sum1 - minus1
print(total)
else :
x = []
y = []
sum1 = 0
minus1 = 0
total = 0
for i in range(len(value)) :
if value[i] == '+' :
x.append(value[i+1])
if value[i] == '-' :
y.append(value[i+1])
for i in x :
sum1 += int(i)
sum1 = sum1 + int(value[0])
for i in y :
minus1 += int(i)
total = sum1 - minus1
print(total)
|
# 1642106, 2022-09-24 10:34:26, Pxxxx (20%) d = input() v = [] a = [] t = [] d = int(d) print(d) | # 1642361, 2022-09-24 10:37:44, Pxxxx (20%) d = input() v = [] a = [] t = [] q = ['0','1','2','3','4','5','6','7','8','9'] d = int(d) print(d) |
# 1641144, 2022-09-24 10:16:22, xx-x- (0%)
a = str(input())
c=0
z=0
if a[0] == "-":
for i in a:
if i in "+-":
c+=1
if c == 1:
print(z[1:])
else:
for i in a:
if i == "+":
z= a[:i]+a[i:]
print(z)
| # 1641485, 2022-09-24 10:23:24, P---- (20%) a = input() print(a) |
# 1640646, 2022-09-24 10:03:29, xx-xx (0%)
n=input().split('-')
q=''
for i in range(len(n)):
if '-' not in n[i]:
q='+'.join(n[i])
q=q.split('+')
else: n=n[i]
q=[int(i) for i in q]
plus=sum(q)
n=[int(i) for i in n]
minu=(-1)*sum(n)
print(plus+minu)
| # 1641339, 2022-09-24 10:20:14, -P--- (20%)
n=input().split('-')
q=''
w=''
for i in range(len(n)):
if '-' not in n[i]:
q=n[i]
q=q.split('+')
else: w=n[i]
q=[int(i) for i in q]
plus=sum(q)
w=[int(i) for i in w]
minu=(-1)*sum(w)
print(plus+minu)
|
# 1641275, 2022-09-24 10:19:05, compilation error (0%)
i = input()
n = []
k = 0
if '+' not in i :
print(i)
else :
| # 1641285, 2022-09-24 10:19:13, P---- (20%)
i = input()
n = []
k = 0
if '+' not in i :
print(i)
|
# 1642067, 2022-09-24 10:33:52, Pxxxx (20%) x=int(input()) print(x) |
# 1640800, 2022-09-24 10:07:23, Pxxxx (20%) x=str(input()) ans=int(x) print(ans) |
# 1642408, 2022-09-24 10:38:21, P---- (20%)
a = input().split("+")
b = []
for elem in a:
b.append(elem.split("-"))
for indx in range(len(b)):
for inx in range(len(b[indx])):
if b[indx][inx] == '':
b[indx][inx+1] = int(b[indx][inx+1])
b[indx][inx+1] = -b[indx][inx+1]
b[indx][inx] = 0
else:
b[indx][inx] = int(b[indx][inx])
if b[indx][inx] < 0:
pass
else:
b[indx][inx] = -b[indx][inx]
if b[indx][0] == 0 and b[indx][1] < 0:
b[indx] = b[indx][1:]
b[indx] = sum(b[indx])
print(sum(b))
|
# 1641940, 2022-09-24 10:31:29, Pxxxx (20%) x = input() x = int(x) print(x) |
# 1640145, 2022-09-24 09:49:27, Pxxxx (20%) x = int(input()) print(x) |
# 1641558, 2022-09-24 10:24:42, P---- (20%)
a = input()
e = []
for i in range(len(a)):
if i == '+':
a.split('+')
elif i == '-':
a.split('-')
print(a)
|
# 1642394, 2022-09-24 10:38:13, P---- (20%) x = input() print(x) |
# 1639691, 2022-09-24 09:36:47, P---- (20%) a = input() print(a) |
# 1642098, 2022-09-24 10:34:19, P---- (20%) x=input() print(x) |
# 1642056, 2022-09-24 10:33:41, Pxxxx (20%) n = int(input()) print(n) |
# 1642321, 2022-09-24 10:37:21, -P--- (20%)
n = input()
su = 0
s = []
l = ''
cl = []#เครื่องหมาย
plus = []
minus = []
for i in range(len(n)) :
s.append(n[i])
for i in range(len(s)) :
if s[i] == '+' :
cl.append('+')
if s[i] == '-' :
cl.append('-')
s = [str(i) for i in s]
for i in range(len(s)) :
if s[i] == '+' :
l += '-'
if s[i] != '+' :
l += s[i]
if s[i] == '-' :
l += ' '
l = l.split("-")
if s[0] == '-' :
l = l[1:]
l = [int(i) for i in l]
for i in range(len(l)) :
su += l[i]
print(su)
|
# 1642079, 2022-09-24 10:34:08, Pxxxx (20%) x = input() print(int(x)) |
# 1641707, 2022-09-24 10:27:23, Pxxxx (20%) a = int(input()) print(a) |
# 1641591, 2022-09-24 10:25:24, P---- (20%) x = input() print(x) |
# 1641105, 2022-09-24 10:15:26, P---- (20%) x = input() print(x) |
# 1642420, 2022-09-24 10:38:30, P---- (20%)
a = input()
op = []
s = []
ans = []
for i in a:
if i == '-':
op+=['-']
elif i == '+':
op += ['+']
a = a.split('+')
for i in range(len(a)):
if '-' in a[i]:
a[i] = a[i].split('-')
if a[0][0]=='':
a[0].remove(a[0][0])
for i in a:
if type(i) == str:
s += [int(i)]
elif type(i) == list:
for o in i:
s += [int(o)]
if len(s) == len(op):
for i in range(len(s)):
for u in op:
if u == '-':
ans += [-s[i]]
i+=1
break
elif u == '+':
ans += [i]
i+=1
break
else:
for i in range(len(s)):
if i == 0:
ans += [s[i]]
i+=1
for u in op:
if u == '-':
ans += [-s[i]]
i+=1
break
elif u == '+':
ans += [i]
i+=1
break
print(sum(ans))
|
# 1641984, 2022-09-24 10:32:24, -P--- (20%)
n = input()
plus = n.split('+')
s = []
m = []
d = []
c = 0
diff = []
for e in plus :
if "-" in e :
m.append(e)
if '-' not in e :
s.append(int(e))
sum_value = sum(s)
for e in m :
for i in range(len(e)) :
if e[i] in '0123456789' :
d.append(int(e[i]))
for i in range(len(d)-1) :
c += -d[i+1]
if e[0] == '-' :
d[0] = -d[0]
c += d[0]
else :
c = d[0] - c
diff.append(-c)
min_value = sum(diff)
print(min_value + sum_value)
|
# 1641550, 2022-09-24 10:24:35, P---- (20%) x = input() print(x) |
# 1641428, 2022-09-24 10:22:03, P---- (20%) print(input()) |
# 1641495, 2022-09-24 10:23:36, Px-xx (20%)
x = input()
g = x.split('-')
if g[0] in ['']:
g = g[1:]
for i in range(len(g)):
g[i] = int(g[i])
if x[0] in ['-']:
print ('-'+str(sum(g)))
else :
print(sum(g))
|
# 1642120, 2022-09-24 10:34:36, P---- (20%)
x = input()
y = ''
c = 0
if x[0] != "-":
for e in x :
if e not in "-+":
y += e
else :
break
if y != '':
c += int(y)
d = len(y)
y = ''
if x[0] == "-":
for e in x[1:] :
if e not in "-+":
y += e
else :
break
if y != '':
c -= int(y)
d = len(y)+1
y = ''
for e in x[d:]:
if e == "+":
for e in x[d+1:] :
if e not in "+-":
y += e
else:
break
c += int(y)
y = ''
if e == "-":
for e in x[d+1:] :
if e not in "-+":
y += e
else:
break
c -= int(y)
y = ''
print(c)
|
# 1638908, 2022-09-24 09:17:50, -P--- (20%)
a=input()
b=a.split('-')
for x in range(len(b)):
c=b[x].split('+')
d=c[:]
f=0
for i in range(len(d)):
f+=int(d[i])
print(f)
|
# 1639991, 2022-09-24 09:44:53, P---- (20%) n = input() print(n) |
# 1640263, 2022-09-24 09:52:25, P---- (20%) s = str(input()) print(s) |
# 1641610, 2022-09-24 10:25:40, P---- (20%) s = str(input()) print(s) |
# 1639942, 2022-09-24 09:43:43, ----- (0%)
t = input().split("+" and "-")
| # 1640923, 2022-09-24 10:10:28, compilation error (0%)
t = input().split("+")
res1 = 0
int(i) for i in range(i+1):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = t.split("-")
int(r) for r in range(r+1):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1640931, 2022-09-24 10:10:43, xxxxx (0%)
t = input().split("+")
res1 = 0
for i in range(i+1):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = t.split("-")
for r in range(r+1):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641022, 2022-09-24 10:13:04, xxxxx (0%)
t = input().split("+")
res1 = 0
for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = t.split("-")
for r in range(len(t)):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641042, 2022-09-24 10:13:41, compilation error (0%)
t = input().split("+")
res1 = 0
int(i) for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = t.split("-")
int(r) for r in range(len(t)):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641088, 2022-09-24 10:15:06, xxxxx (0%)
t = input().split("+")
res1 = 0
for i in t:
int(i)
for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = t.split("-")
for r in t:
int(r)
for r in range(len(t)):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641183, 2022-09-24 10:17:13, compilation error (0%)
t = [int(e) for e in input().split("+")]
res1 = 0
for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = [int(t) for t.split("-")]
for r in t:
int(r)
for r in range(len(t)):
f = abs(t[r])+abs(t[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641200, 2022-09-24 10:17:35, compilation error (0%)
t = [int(e) for e in input().split("+")]
res1 = 0
for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = [int(t) for t.split("-")]
for r in d:
int(r)
for r in range(len(t)):
f = abs(d[r])+abs(d[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641494, 2022-09-24 10:23:36, compilation error (0%)
t = [int(e) for e in input().split("+")]
res1 = 0
for i in range(len(t)):
s = abs(t[i])+abs(t[i+1])
res1 += s
res2 = 0
d = [int(r) for r in t.split("-")]
int(r) for r in range(len(t)):
f = abs(d[r])+abs(d[r+1])
res2 += f
v = res1 - res2
print(v)
| # 1641993, 2022-09-24 10:32:36, xxxxx (0%)
t = input().split("+")
q= []
for i in t:
q.append(int(i))
res1 = 0
for i in range(len(t)):
s = abs(q[i])+abs(q[i+1])
res1 += s
res2 = 0
d = t.split("-")
k = []
for r in d:
k.append(int(r))
for r in range(len(t)):
f = abs(d[r])+abs(d[r+1])
res2 += f
v = res1 - res2
print(v)
|
# 1639017, 2022-09-24 09:20:20, ----- (0%)
def f1(a, b, c):
if a>0:
minn=a
elif b>0 and b<a:
minn=b
elif c>0 and c<minn:
minn=c
return minn
| # 1639028, 2022-09-24 09:20:36, ----- (0%)
def f1(a, b, c):
if a>0:
minn=a
elif b>0 and b<a:
minn=b
elif c>0 and c<minn:
minn=c
return minn
| # 1639102, 2022-09-24 09:22:11, ----- (0%)
def f1(a, b, c):
if a>0:
minn=a
elif b>0 and b<a:
minn=b
elif c>0 and c<a and c<b:
minn=c
return minn
| # 1639150, 2022-09-24 09:23:15, ----- (0%)
def f1(a, b, c):
if a>0:
minn=a
elif b>0 and b<a:
minn=b
elif c>0 and c<a and c<b:
minn=c
return int(minn)
| # 1639351, 2022-09-24 09:28:16, ----- (0%)
def f1(a, b, c):
minn=0
x=[a,b,c]
for e in x:
if e <0:
x.remove(e)
return min(x)
| # 1639503, 2022-09-24 09:31:53, ----- (0%)
def f1(a, b, c):
x=[a,b,c]
for i in range(3):
x[i]=int(x[i])
for e in x:
if e <0:
x.remove(e)
return min(x)
| # 1639615, 2022-09-24 09:34:47, ----- (0%)
def f1(a, b, c):
x=[a,b,c]
for i in range(3):
x[i]=int(x[i])
for e in x:
if e <0:
x.remove(e)
return min(x)
def f2(a, b, c):
x=[a,b,c]
d=[]
for i in range(3):
d.append(int(x[i]))
for e in d:
if e>0:
d.remove(e)
return max(d)
| # 1639633, 2022-09-24 09:35:11, ----- (0%)
def f1(a, b, c):
x=[a,b,c]
for i in range(3):
x[i]=int(x[i])
for e in x:
if e <0:
x.remove(e)
return min(x)
def f2(a, b, c):
x=[a,b,c]
d=[]
for i in range(3):
d.append(int(x[i]))
for e in d:
if e>0:
d.remove(e)
return max(d)
exec(input().strip())
| # 1642329, 2022-09-24 10:37:26, x--xx (0%)
x=input().split('-')
c=0
for e in x:
if '+' in e:
c+=int(e[0])+int(e[2])
x.remove(e)
d=[]
for i in range(len(x)):
d.append(int(x[i]))
a=sum(d)
print(a-c)
|
# 1641062, 2022-09-24 10:14:05, TTTTT (0%)
z = input()
y = ''
b = ''
i = 0
while i < len(z) :
for i in range(len(z)) :
if z[i] == '+' :
y += z[i+1]
elif z[i] == '-' :
y += z[i+1]
| # 1641463, 2022-09-24 10:22:50, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(z) :
if z[i] == '+' :
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum - ym_sum
print(summ)
| # 1641507, 2022-09-24 10:23:50, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(z) :
if z[i] == '+' :
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum + ym_sum
print(summ)
| # 1641574, 2022-09-24 10:24:52, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(z) :
if z[i] == '+' :
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum + ym_sum
print(summ)
| # 1641632, 2022-09-24 10:26:03, xTTTx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(len(z)) :
if z[i] == '+' :
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum + ym_sum
print(summ)
| # 1641898, 2022-09-24 10:30:40, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(len(z)) :
if z[i] == '+' or z[i] == '-' :
break
elif z[i] in num :
yp += ''
yp_sum += int(yp)
for i in range(len(z)) :
if z[i] == '+' :
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum + ym_sum
print(summ)
| # 1641987, 2022-09-24 10:32:28, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(len(z)) :
if z[i] == '+' or z[i] == '-' :
break
elif z[i] in num :
yp += ''
yp_sum += int(yp)
yp = ''
for i in range(len(z)) :
if z[i] == '+' :
yp = ''
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
yp_sum += int(yp)
elif z[i] == '-' :
ym = ''
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
ym_sum += int(ym)
summ =yp_sum + ym_sum
print(summ)
| # 1642181, 2022-09-24 10:35:30, xxxxx (0%)
z = input()
yp = ''
yp_sum = 0
ym = ''
ym_sum = 0
num = '0123456789'
c = 0
for i in range(len(z)) :
if z[i] == '+' or z[i] == '-' :
break
elif z[i] in num :
yp += ''
yp_sum += int(yp)
yp = ''
for i in range(len(z)) :
if z[i] == '+' :
yp_sum += int(yp)
yp = ''
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
elif z[i] == '-' :
ym_sum += int(ym)
ym = ''
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
summ =yp_sum + ym_sum
print(summ)
| # 1642342, 2022-09-24 10:37:31, TxTTT (0%)
z = input()
yp = '0'
yp_sum = 0
ym = '0'
ym_sum = 0
num = '0123456789'
c = 0
for i in range(len(z)) :
if z[i] == '+' or z[i] == '-' :
break
elif z[i] in num :
yp += ''
yp_sum += int(yp)
yp = ''
for i in range(len(z)) :
if z[i] == '+' :
yp_sum += int(yp)
yp = ''
for i in range(len(z)) :
while z[i] in num :
yp += z[i]
elif z[i] == '-' :
ym_sum += int(ym)
ym = ''
for i in range(len(z)) :
while z[i] in num :
ym += z[i]
summ =yp_sum + ym_sum
print(summ)
|
# 1639848, 2022-09-24 09:40:57, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1640354, 2022-09-24 09:55:30, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1640376, 2022-09-24 09:56:01, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1640404, 2022-09-24 09:57:00, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if d<a:break
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1640754, 2022-09-24 10:06:13, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if d<a:break
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1641101, 2022-09-24 10:15:20, compilation error (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if d<a
break
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1641119, 2022-09-24 10:15:49, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1642002, 2022-09-24 10:32:50, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
| # 1642419, 2022-09-24 10:38:29, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b=b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
elif c%2==0:
d=d+a
elif d>c:
c=c+d
else:
b=b+a
a=b+c
print(a,b,c,d)
|
# 1641001, 2022-09-24 10:12:39, compilation error (0%)
list = [input().split()]:
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
print(sum(blank))
| # 1641032, 2022-09-24 10:13:13, compilation error (0%)
list = input().split():
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
print(sum(blank))
| # 1641153, 2022-09-24 10:16:37, compilation error (0%)
list = input().split(+):
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
print(sum(blank))
| # 1641206, 2022-09-24 10:17:45, compilation error (0%)
list = input().split('+'):
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
print(sum(blank))
| # 1641266, 2022-09-24 10:18:54, compilation error (0%)
list = input()
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
hope = sum(blank)
print(hope)
| # 1641364, 2022-09-24 10:20:47, xxxxx (0%)
list = input()
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
blank.split('+')
for i in blank:
blank[i] = int(blank[i])
print(sum(blank))
| # 1642253, 2022-09-24 10:36:31, xxxxx (0%)
list = input()
blank = []
none = []
for idx,x in enumerate(list):
if idx % 2 != 0:
blank.append(x)
else:
none.append(x)
blank.split('+')
for i in blank:
blank[i] = int(blank[i])
print(sum(blank))
|
# 1642278, 2022-09-24 10:36:49, xxxxx (0%)
x = input()
m = [0]*len(x)
for i in range(0,len(m)):
if x[i+1] != '-' and x[i-1] != '+':
if x[i] == " - ":
m = int(x[i]+x[i+1])
if x[i+1] != '-' and x[i+2] != '-' and x[i+3] != '-'and x[i-1] != '+'and x[i-2] != '+'and x[i-3] != '+':
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
| # 1642322, 2022-09-24 10:37:22, xxxxx (0%)
x = input()
m = [0]*len(x)
for i in range(0,len(m)):
if x[i+1] != '-' and x[i-1] != '+':
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
| # 1642392, 2022-09-24 10:38:11, ----- (0%)
x = input()
m = [0]*len(x)
for i in range(0,len(m)):
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
| # 1642410, 2022-09-24 10:38:21, ----- (0%)
x = input()
m = [0]*len(x)
i = 0
for i in range(0,len(m)):
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
| # 1642428, 2022-09-24 10:38:36, ----- (0%)
x = input()
m = [0]*len(x)
i = 0
for i in range(0,len(m)):
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
| # 1642454, 2022-09-24 10:38:53, ----- (0%)
x = input()
m = [0]*len(x)
for i in range(0,len(m)):
if x[i] == " - ":
m = int(x[i]+x[i+1])
print(sum(m))
|
# 1639976, 2022-09-24 09:44:24, compilation error (0%)
def f1(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) > 0 :
y.append(x[i])
y.sort()
ans = y[0]
return ans
def f2(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) < 0 :
y.append(x[i])
y.sort()
ans = y[-1]
return ans
def f3(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = y[0]
return ans
def f4(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = y[-1]
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 ==0 and s2 ==0 :
| # 1640114, 2022-09-24 09:48:43, ----- (0%)
def f1(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) > 0 :
y.append(x[i])
y.sort()
ans = y[0]
return ans
def f2(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) < 0 :
y.append(x[i])
y.sort()
ans = y[-1]
return ans
def f3(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = y[0]
return ans
def f4(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = y[-1]
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 ==0 and s2 ==0 :
print(f1(a,b,c))
if s1 ==0 and s2 ==1 :
print(f2(a,b,c))
if s1 ==1 and s2 ==0 :
print(f3(a,b,c))
if s1 ==1 and s2 ==1 :
print(f4(a,b,c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
| # 1640195, 2022-09-24 09:50:44, ----- (0%)
def f1(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) > 0 :
y.append(x[i])
y.sort()
ans = int(y[0])
return ans
def f2(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) < 0 :
y.append(x[i])
y.sort()
ans = int(y[-1])
return ans
def f3(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[0])
return ans
def f4(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[-1])
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 ==0 and s2 ==0 :
print(f1(a,b,c))
if s1 ==0 and s2 ==1 :
print(f2(a,b,c))
if s1 ==1 and s2 ==0 :
print(f3(a,b,c))
if s1 ==1 and s2 ==1 :
print(f4(a,b,c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
| # 1640301, 2022-09-24 09:53:39, ----- (0%)
def f1(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) > 0 :
y.append(x[i])
y.sort()
ans = int(y[0])
return ans
def f2(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) < 0 :
y.append(x[i])
y.sort()
ans = int(y[-1])
return ans
def f3(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[0])
return ans
def f4(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[-1])
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 ==0 and s2 ==0 :
print(f1(a,b,c))
if s1 ==0 and s2 ==1 :
print(f2(a,b,c))
if s1 ==1 and s2 ==0 :
print(f3(a,b,c))
if s1 ==1 and s2 ==1 :
print(f4(a,b,c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
| # 1640374, 2022-09-24 09:56:00, ----- (0%)
def f1(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) > 0 :
y.append(x[i])
y.sort()
ans = int(y[0])
return int(ans)
def f2(a,b,c):
x = [a,b,c]
y = []
for i in range(3):
if int(x[i]) < 0 :
y.append(x[i])
y.sort()
ans = int(y[-1])
return int(ans)
def f3(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[0])
return int(ans)
def f4(a,b,c):
x = int(a)+int(b)+int(c)
y = ""
for e in str(x):
if e not in "-":
y += e
ans = int(y[-1])
return int(ans)
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1 ==0 and s2 ==0 :
print(f1(a,b,c))
if s1 ==0 and s2 ==1 :
print(f2(a,b,c))
if s1 ==1 and s2 ==0 :
print(f3(a,b,c))
if s1 ==1 and s2 ==1 :
print(f4(a,b,c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
|
# 1640169, 2022-09-24 09:50:21, xxxxx (0%)
x = input()
for c in x:
if c == '-' or c == '+':
# -1+20-300+4000
# 0123456789
for i in range(len(x)):
c[i-1]
| # 1641045, 2022-09-24 10:13:47, xxxxx (0%)
x = input()
range_index = [0]
for c in x:
if c == '-' or c == '+':
# -1+20-300+4000
# 0123456789
for i in range(len(x)):
range_index.append(c[i+1])
num = []
for i in range(1, len( range_index)-1):
start = range_index[i]
stop = range_index[i+1]
ch = x[start:stop]
num.append(ch)
print(sum(num))
| # 1641218, 2022-09-24 10:17:57, xxxxx (0%)
x = input()
range_index = [0]
for c in x:
if c == '-' or c == '+':
# -1+20-300+4000
# 0123456789
for i in range(1, len(x)):
range_index.append(c[i-1])
num = []
for i in range(1, len( range_index)-1):
start = range_index[i]
stop = range_index[i+1]
ch = x[start:stop]
num.append(ch)
print(sum(num))
| # 1641608, 2022-09-24 10:25:38, xxxxx (0%)
x = input()
range_index = [0]
for c in x:
if c == '-' or c == '+':
# -1+20-300+4000
# 0123456789
for i in range(len(x)-1):
range_index += c[i-1]
# range_index = [0,
num = []
for i in range(1, len( range_index)-1):
start = range_index[i]
stop = range_index[i+1]
ch = x[start:stop]
num.append(ch)
print(sum(num))
| # 1642017, 2022-09-24 10:33:00, xxxxx (0%)
x = input()
range_index = [0]
for c in x:
if c == '-' or c == '+':
# -1+20-300+4000
# 0123456789
for i in range(1, len(x)-1):
range_index += c[i-1]
# range_index = [0,
num = []
for i in range(1, len( range_index)-1):
start = range_index[i]
stop = range_index[i+1]
ch = x[start:stop]
num.append(ch)
print(sum(num))
|
# 1640206, 2022-09-24 09:51:07, ----- (0%)
def f1(a, b, c):
if a<0:
pass
else:
minf1 = a
if b<0:
pass
elif b<minf1:
minf1 = b
if c<0:
pass
elif c<minf1:
minf1 = c
return minf1
def f2(a, b, c):
if a<0:
maxf2 = a
else:
pass
if b<0 and b>maxf2:
maxf2 = b
if c<0 and c>maxf2:
maxf2 = c
return maxf2
def f3(a, b, c):
total = a+b+c
total = str(total)
if "-" in total:
total = total[1:]
ans = total[0]
return ans
def f4(a, b, c):
total = a+b+c
total = str(total)
ans = total[-1]
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2==0:
print(f1(a,b,c))
if s1==0 and s2==1:
print(f2(a,b,c))
if s1==1 and s2==0:
print(f3(a,b,c))
if s1==1 and s2==1:
print(f4(a,b,c))
else:
print("Error")
| # 1640731, 2022-09-24 10:05:46, ----- (0%)
def f1(a, b, c):
if a<0:
pass
else:
minf1 = a
if b<0:
pass
elif b<minf1:
minf1 = b
if c<0:
pass
elif c<minf1:
minf1 = c
return minf1
def f2(a, b, c):
if a<0:
maxf2 = a
else:
pass
if b<0 and b>maxf2:
maxf2 = b
if c<0 and c>maxf2:
maxf2 = c
return maxf2
def f3(a, b, c):
total = a+b+c
total = str(total)
if "-" in total:
total = total[1:]
ans = total[0]
return ans
def f4(a, b, c):
total = a+b+c
total = str(total)
ans = total[-1]
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2==0:
print(f1(a,b,c))
if s1==0 and s2==1:
print(f2(a,b,c))
if s1==1 and s2==0:
print(f3(a,b,c))
if s1==1 and s2==1:
print(f4(a,b,c))
else:
print("Error")
exec(input().strip())
| # 1640897, 2022-09-24 10:09:53, ----- (0%)
def f1(a, b, c):
if a<0:
pass
else:
minf1 = a
if b<0:
pass
elif b<minf1:
minf1 = b
if c<0:
pass
elif c<minf1:
minf1 = c
return minf1
def f2(a, b, c):
if a<0:
maxf2 = a
else:
pass
if b<0 and b>maxf2:
maxf2 = b
if c<0 and c>maxf2:
maxf2 = c
return maxf2
def f3(a, b, c):
total = a+b+c
total = str(total)
if "-" in total:
total = total[1:]
ans = total[0]
return ans
def f4(a, b, c):
total = a+b+c
total = str(total)
ans = total[-1]
return ans
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2==0:
print(f1(a,b,c))
elif s1==0 and s2==1:
print(f2(a,b,c))
elif s1==1 and s2==0:
print(f3(a,b,c))
elif s1==1 and s2==1:
print(f4(a,b,c))
else:
print("Error")
exec(input().strip())
| # 1641026, 2022-09-24 10:13:08, ----- (0%)
def f1(a, b, c):
if a<0:
pass
else:
minf1 = a
if b<0:
pass
elif b<minf1:
minf1 = b
if c<0:
pass
elif c<minf1:
minf1 = c
return int(minf1)
def f2(a, b, c):
if a<0:
maxf2 = a
else:
pass
if b<0 and b>maxf2:
maxf2 = b
if c<0 and c>maxf2:
maxf2 = c
return int(maxf2)
def f3(a, b, c):
total = a+b+c
total = str(total)
if "-" in total:
total = total[1:]
ans = total[0]
return int(ans)
def f4(a, b, c):
total = a+b+c
total = str(total)
ans = total[-1]
return int(ans)
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2==0:
print(f1(a,b,c))
if s1==0 and s2==1:
print(f2(a,b,c))
if s1==1 and s2==0:
print(f3(a,b,c))
if s1==1 and s2==1:
print(f4(a,b,c))
else:
print("Error")
exec(input().strip())
| # 1641613, 2022-09-24 10:25:42, ----- (0%)
def f1(a, b, c):
if a>0:
minf1 = a
elif b>0 and b<minf1:
minf1 = b
elif c>0 and c<minf1:
minf1 = c
return int(minf1)
def f2(a, b, c):
if a<0:
maxf2 = a
elif b<0 and b>maxf2:
maxf2 = b
elif c<0 and c>maxf2:
maxf2 = c
return int(maxf2)
def f3(a, b, c):
total = a+b+c
total = str(total)
if "-" in total:
total = total[1:]
ans = total[0]
return int(ans)
def f4(a, b, c):
total = a+b+c
total = str(total)
ans = total[-1]
return int(ans)
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1==0 and s2==0:
print(f1(a,b,c))
if s1==0 and s2==1:
print(f2(a,b,c))
if s1==1 and s2==0:
print(f3(a,b,c))
if s1==1 and s2==1:
print(f4(a,b,c))
else:
print("Error")
exec(input().strip())
|
# 1641730, 2022-09-24 10:27:53, x---- (0%)
text = input()+''
numbers = []
operation = []
count = 0
temp = 0
buffer = ''
for i, j in enumerate(text):
if j.isnumeric():
buffer = buffer+j
elif j == '-' and i == 0:
buffer = j + buffer
else:
if j != ' ':
operation.append(j)
numbers.append(int(buffer))
buffer = ''
if len(operation) != 0:
for i, j in enumerate(numbers):
if i == 0:
temp = j
elif operation[count] == "+":
temp = temp + j
elif operation[count] == "-":
temp -= j
count = count + 1
else:
temp = numbers[0]
print(temp)
| # 1641776, 2022-09-24 10:28:46, compilation error (0%)
text = input()+''
numbers = []
operation = []
count = 0
temp = 0
buffer = ''
for i, j in enumerate(text):
if j.
buffer = buffer+j
elif j == '-' and i == 0:
buffer = j + buffer
else:
if j != ' ':
operation.append(j)
numbers.append(int(buffer))
buffer = ''
if len(operation) != 0:
for i, j in enumerate(numbers):
if i == 0:
temp = j
elif operation[count] == "+":
temp = temp + j
elif operation[count] == "-":
temp -= j
count = count + 1
else:
temp = numbers[0]
print(temp)
| # 1641882, 2022-09-24 10:30:27, xxxxx (0%)
a = input()
b = []
c = []
d = 0
if not a[0] == "-":
a = "+" + a
for i in range(len(a)):
if a[i] == '-':
c.append(-1)
b.append(a[d:i])
d = i+1
if a[i] == '+':
c.append(1)
b.append(a[d:i])
d = i+1
if i == len(a)-1:
e = (a.split('+')).index
f = a.split('-')
b.append(min(e[-1], e[-1]))
print(b)
print(c)
| # 1641970, 2022-09-24 10:32:07, xxxxx (0%)
a = input()
b = []
c = []
d = 0
if not a[0] == "-":
a = "+" + a
for i in range(len(a)):
if a[i] == '-':
c.append(-1)
b.append(a[d:i])
d = i+1
if a[i] == '+':
c.append(1)
b.append(a[d:i])
d = i+1
if i == len(a)-1:
e = (a.split('+')).index
f = a.split('-')
b.append(min(e[-1], e[-1]))
print(b)
print(c)
| # 1642435, 2022-09-24 10:38:40, xxxxx (0%)
a = input()
b = []
c = []
d = 0
e = 0
if not a[0] == "-":
a = "+" + a
for i in range(len(a)):
if a[i] == '-':
c.append(-1)
b.append(a[d:i])
d = i+1
if a[i] == '+':
c.append(1)
b.append(a[d:i])
d = i+1
if i == len(a)-1:
b.append(a[-1])
print(b)
print(c)
for i in range(len(b)):
e = e + (int(d[i])*int(c[i]))
print(e)
|
# 1642149, 2022-09-24 10:35:12, xxxxx (0%)
x = input()
out = []
c = 0
for e in x:
if e != '-' and e != '+':
out.append(e)
c += e
print(c)
| # 1642221, 2022-09-24 10:36:04, xxxxx (0%)
x = input()
out = ''
c = 0
for e in x:
if e != '-' and e != '+':
out += e
c += e
print(c)
| # 1642281, 2022-09-24 10:36:51, xxxxx (0%)
x = input()
out = ''
c = 0
for e in x:
if e != '-' and e != '+':
out += int(e)
c += e
print(c)
| # 1642447, 2022-09-24 10:38:48, compilation error (0%)
x = input().split()
out = []
for e in x:
out.append(int(e)
x = sum(out)
print(x)
|
# 1641782, 2022-09-24 10:28:55, -xxxx (0%)
q = str(input())
a = []
plus = 0
minus = 0
for i in range(0,2):
if q[i] == '+' or q[i] =='-':
a.append(q[i+1])
else: a.append(q[i])
for j in range(2,len(q)-1):
if q[j] == '+' or q[j] =='-':
a.append(q[j+1])
if q[0] == '-':
minus += int(a[0])
else:
minus += int(a[0])
for k in range (1,len(q)):
if q[k] == '+':
plus += int(a[k-1])
elif q[k] == '-':
minus += int(a[k-1])
print(int(plus)- int(minus))
| # 1642112, 2022-09-24 10:34:33, xxxxx (0%)
q = str(input())
a = []
plus = 0
minus = 0
if '0'<= q[0] <='9':
plus += int(q[0])
for i in range (1,len(q)):
if '0'<= q[i] <='9':
q[i] = int(q[i])
if q[i-1] == '+':
plus += q[i]
if q[i-1] == '-':
minus += q[i]
elif q[0] == '-':
minus += q[1]
for i in range (1,len(q)):
if '0'<= q[i] <='9':
q[i] =int(q[i])
if q[i-1] == '+':
plus += q[i]
if q[i-1] == '-':
minus += q[i]
print(int(plus)- int(minus))
| # 1642210, 2022-09-24 10:35:57, x---x (0%)
q = str(input())
a = []
plus = 0
minus = 0
if '0'<= q[0] <='9':
plus += int(q[0])
for i in range (1,len(q)):
if q[i-1] == '+':
plus += int(q[i])
if q[i-1] == '-':
minus += int(q[i])
elif q[0] == '-':
minus += q[1]
for i in range (1,len(q)):
if '0'<= q[i] <='9':
q[i] =int(q[i])
if q[i-1] == '+':
plus += int(q[i])
if q[i-1] == '-':
minus += int(q[i])
print(int(plus)- int(minus))
| # 1642461, 2022-09-24 10:39:01, x---x (0%)
q = str(input())
a = []
plus = 0
minus = 0
if len(q) == 2 or len(q)== 3:
print(q)
else:
if '0'<= q[0] <='9':
plus += int(q[0])
for i in range (1,len(q)):
if q[i-1] == '+':
plus += int(q[i])
if q[i-1] == '-':
minus += int(q[i])
elif q[0] == '-':
minus += int(q[1])
for i in range (1,len(q)):
if '0'<= q[i] <='9':
q[i] =int(q[i])
if q[i-1] == '+':
plus += int(q[i])
if q[i-1] == '-':
minus += int(q[i])
print(int(plus)- int(minus))
|
# 1641943, 2022-09-24 10:31:30, xxxxx (0%)
t = input().split("+","-")
| # 1642043, 2022-09-24 10:33:28, ----- (0%)
print("20")
| # 1642054, 2022-09-24 10:33:40, ----- (0%) print(20) | # 1642062, 2022-09-24 10:33:48, xxxxx (0%)
t = input().split("+","-")
|
# 1641083, 2022-09-24 10:15:01, compilation error (0%)
def f1(a, b, c):
p=[]
if a>0:
if b>0:
if c>0:
return(min(p))
def f2(a, b, c):
u=[]
if a>0:
if b>0:
if c>0:
return(max(u))
def f3(a, b, c):
a+b+c=w
return(w[0])
def f4(a, b, c):
a+b+c=e
return(e[-1])
def main():
s1=int(input())
s2=int(input())
a=int(input())
b=int(input())
c=int(input())
exec(input().strip())
| # 1642082, 2022-09-24 10:34:11, compilation error (0%)
def f1(a, b, c):
p=[]
if int(a)>0:
p+=[a]
if int(b)>0:
p+=[b]
if int(c)>0:
p+=[c]
return(min(p))
def f2(a, b, c):
u=[]
if int(a)<0:
p+=[a]
if int(b)<0:
p+=[b]
if int(c)<0:
p+=[c]
return(max(u))
def f3(a, b, c):
w=int(a)+int(b)+int(c)
return(w[0])
def f4(a, b, c):
e=int(a)+int(b)+int(c)
return(e[-1])
def main():
s1,s2,a,b,c=[int(e) for e in input().split()]
if s1=0 and s2=0:
m=f1(a, b, c)
if s1=0 and s2=1:
m=f2(a, b, c)
else:
m=('Error')
| # 1642206, 2022-09-24 10:35:51, ----- (0%)
def f1(a, b, c):
p=[]
if int(a)>0:
p+=[a]
if int(b)>0:
p+=[b]
if int(c)>0:
p+=[c]
return(min(p))
def f2(a, b, c):
u=[]
if int(a)<0:
p+=[a]
if int(b)<0:
p+=[b]
if int(c)<0:
p+=[c]
return(max(u))
def f3(a, b, c):
w=int(a)+int(b)+int(c)
return(w[0])
def f4(a, b, c):
e=int(a)+int(b)+int(c)
return(e[-1])
def main():
s1,s2,a,b,c=[int(e) for e in input().split()]
if s1==0 and s2==0:
m=f1(a, b, c)
if s1==0 and s2==1:
m=f2(a, b, c)
else:
m=('Error')
| # 1642421, 2022-09-24 10:38:31, ----- (0%)
def f1(a, b, c):
p=[]
if int(a)>0:
p+=[a]
if int(b)>0:
p+=[b]
if int(c)>0:
p+=[c]
return(min(p))
def f2(a, b, c):
u=[]
if int(a)<0:
p+=[a]
if int(b)<0:
p+=[b]
if int(c)<0:
p+=[c]
return(max(u))
def f3(a, b, c):
w=int(a)+int(b)+int(c)
return(w[0])
def f4(a, b, c):
e=int(a)+int(b)+int(c)
return(e[-1])
def main():
s1,s2,a,b,c=[int(e) for e in input().split()]
if s1==0 and s2==0:
m=f1(a, b, c)
if s1==0 and s2==1:
m=f2(a, b, c)
else:
m=('Error')
return print(m)
|
# 1641089, 2022-09-24 10:15:06, ----- (0%)
t = input()
c = 1
d = 0
for i in range(len(t)-1,-1,-1) :
if '0' <= t[i] <= '9' :
d += int(t[i])*c
c *=10
| # 1641349, 2022-09-24 10:20:28, -x-xx (0%)
t = input()
c = 1
d = 0
a = []
for i in range(len(t)-1,-1,-1) :
if '0' <= t[i] <= '9' :
d += int(t[i])*c
c *=10
if t[i] == '-' or t[i] == '+' :
if t[i] == '-' :
d *= -1
if t[i] == '+' :
d += t[i+1]
| # 1642312, 2022-09-24 10:37:17, ----- (0%)
t = input()
c = 0
d = 0
s = 0
a = []
for i in range (len(t)) :
if '0' <= t[i] <= '9' :
c += 1
|
# 1641566, 2022-09-24 10:24:47, x---x (0%)
x = list(input())
y = x[0:len(x):2]
a = int(x[0])
for i in range(len(x)) :
if x[i%2==1] == '+' :
a += int(x[i+1])
elif x[i%2==0] == '-' :
a -= int(x[i+1])
print(a)
| # 1641615, 2022-09-24 10:25:44, x---x (0%)
x = list(input())
y = x[0:len(x):2]
a = int(x[0])
for i in range(len(x)) :
if x[i%2==1] == '+' :
a += int(x[i+1])
elif x[i%2==1] == '-' :
a -= int(x[i+1])
print(a)
| # 1642213, 2022-09-24 10:36:00, xxxxx (0%)
x = list(input())
y = x[0:len(x):2]
for i in range(len(x)) :
a = int(x[i])
if x[i] == '0' or '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9':
x[i] == str(x[i-1])+str(x[i])
if x[i%2==1] == '+' :
a += int(x[i+1])
elif x[i%2==1] == '-' :
a -= int(x[i+1])
print(a)
|
# 1641228, 2022-09-24 10:18:09, ----- (0%)
t = input()
y = 0
found = False
for k in range(len(t)):
if t[k] in "-+":
found = True
else :
y += int(t[k])
if found:
s1 = t[:k]
s2 = t[k+1:]
for r in range (len(s2)) :
if s2[r] in "-+":
found = True
else :
y += int(s2[r])
print(y)
| # 1641605, 2022-09-24 10:25:36, ----- (0%)
s2 = input()
y = 0
for r in range (len(s2)) :
if s2[r] in "-+":
found = True
else :
y += int(s2[r])
print(y)
| # 1642445, 2022-09-24 10:38:46, ----- (0%)
x = input()
y = 0
SSUM = False
for r in range (len(x)) :
if x[r] in "-+":
SSUM = True
else :
y += int(x[r])
print(y)
|
# 1641501, 2022-09-24 10:23:41, xxxxx (0%)
x=y.split("+"or "-")
summary=0
for i in y[::2]:
i=int(i)
if i>=0:
summary+= i
else :
summary += -i
print(summary)
| # 1641764, 2022-09-24 10:28:30, xxxxx (0%)
x=y.split("+"or "-")
| # 1642340, 2022-09-24 10:37:29, ----- (0%)
y=input()
x=y.split("+"or "-")
summary=0
for i in range(len(y)):
if y[i]==int and y[i]!=y[i-1]:
summary.append(y[i])
print(summary)
|
# 1640614, 2022-09-24 10:02:32, ----- (0%)
def f1(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return min(y)
def f2(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return max(y)
def f3(a, b, c):
x = a + b + c
x = x // 10**(len(x)-1) % 10
return x
def main():
s1,s2,a,b,c = input().split()
s1 = int(s1)
s2 = int(s2)
a = int(a)
b = int(b)
c = int(c)
if s1 == 0 and s2 == 0:
print(f1(a, b, c))
elif s1 == 0 and s2 == 1:
print(f2(a, b, c))
elif s1 == 1 and s2 == 0:
print(f3(a, b, c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
| # 1640895, 2022-09-24 10:09:45, ----- (0%)
def f1(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return min(y)
def f2(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return max(y)
def f3(a, b, c):
x = a + b + c
x = str(x)
return x[1]
def f4(a, b, c):
x = a + b + c
x = str(x)
return x[2]
def main():
s1,s2,a,b,c = input().split()
s1 = int(s1)
s2 = int(s2)
a = int(a)
b = int(b)
c = int(c)
if s1 == 0 and s2 == 0:
print(f1(a, b, c))
elif s1 == 0 and s2 == 1:
print(f2(a, b, c))
elif s1 == 1 and s2 == 0:
print(f3(a, b, c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
| # 1640969, 2022-09-24 10:11:43, ----- (0%)
def f1(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return min(y)
def f2(a, b, c):
y = []
for x in [a,b,c]:
if x > 0:
y.append(int(x))
return max(y)
def f3(a, b, c):
x = a + b + c
x = str(x)
return x[1]
def f4(a, b, c):
x = a + b + c
x = str(x)
return x[2]
def main():
s1,s2,a,b,c = input().split()
s1 = int(s1)
s2 = int(s2)
a = int(a)
b = int(b)
c = int(c)
if s1 == 0 and s2 == 0:
print(f1(a, b, c))
elif s1 == 0 and s2 == 1:
print(f2(a, b, c))
elif s1 == 1 and s2 == 0:
print(f3(a, b, c))
elif s1 == 1 and s2 == 1:
print(f4(a, b, c))
else:
print("Error")
exec(input().strip()) # DON'T remove this line
|
# 1641529, 2022-09-24 10:24:16, xxxxx (0%)
x = input() # str
a = 0
out = []
for e in range(len(x)) :
if x[e] == '-' :
x[e+1] = int(x[e+1])
out.append(-1*x[e+1])
elif x[e] == '+' :
x[e+1] = int(x[e+1])
out.append(x[e+1])
elif x[e] in list('0123456789') :
x[e] = int(x[e])
out.append(x[e])
for e in range(len(out)) :
a += out[e]
print(a)
| # 1641637, 2022-09-24 10:26:08, xxxxx (0%)
x = input() # str
a = 0
out = []
for e in range(len(x)) :
if x[e] == '-' :
x[e+1] = int(x[e+1])
b = -1*x[e+1]
out.append(b)
elif x[e] == '+' :
x[e+1] = int(x[e+1])
b = x[e+1]
out.append(b)
elif x[e] in list('0123456789') :
x[e] = int(x[e])
out.append(x[e])
for e in range(len(out)) :
a += out[e]
print(a)
| # 1642140, 2022-09-24 10:34:56, xxxxx (0%)
x = input() # str
a = 0
out = []
for e in range(len(x)) :
if x[e] == '-' :
x[e+1] = int(x[e+1])
b = -1*x[e+1]
out.append(b)
elif x[e] == '+' :
x[e+1] = int(x[e+1])
b = x[e+1]
out.append(b)
elif x[e] in list('0123456789') :
x[e] = int(x[e])
out.append(x[e])
for e in range(len(out)) :
a += out[e]
a = int(a)
print(a)
|
# 1641289, 2022-09-24 10:19:18, ----- (0%)
a=str(input().strip())
x=[]
n=[0,1,2,3,4,5,6,7,8,9]
o=['+','-','/','*']
sum=0
for i in range(1,len(a)-1):
if a[i] in o:
if a[i]==o[0]:
x.append(int(a[i-1])+int(a[i+1]))
if a[i]==o[1]:
x.append(int(a[i-1])-int(a[i+1]))
if a[i]==o[2]:
x.append(int(a[i-1])*int(a[i+1]))
if a[i]==o[3]:
x.append(int(a[i-1])/int(a[i+1]))
for i in range(len(x)):
sum+=x[i]
print(sum)
| # 1641366, 2022-09-24 10:20:50, ----- (0%)
a=str(input().strip())
x=[]
n=[0,1,2,3,4,5,6,7,8,9]
o=['+','-','/','*']
sum=0
for i in range(1,len(a)-1):
if a[i] in o:
if a[i]==o[0]:
x.append(int(a[i-1])+int(a[i+1]))
if a[i]==o[1]:
x.append(int(a[i-1])-int(a[i+1]))
if a[i]==o[3]:
x.append(int(a[i-1])*int(a[i+1]))
if a[i]==o[2]:
x.append(int(a[i-1])/int(a[i+1]))
for i in range(len(x)):
sum+=x[i]
print(sum)
| # 1641616, 2022-09-24 10:25:46, xxxxx (0%)
a=str(input().strip())
x=[]
n=[0,1,2,3,4,5,6,7,8,9]
o=['+','-','/','*']
sum=0
for i in range(len(a)):
for j in range(len(a)):
if a[i] in o:
if a[j] in o:
if a[i]==o[0]:
x.append(int(a[j:i])+int(a[i:j]))
if a[i]==o[1]:
x.append(int(a[j:i])-int(a[i:j]))
if a[i]==o[3]:
x.append(int(a[j:i])*int(a[i:j]))
if a[i]==o[2]:
x.append(int(a[j:i])/int(a[i:j]))
for i in range(len(x)):
sum+=x[i]
print(sum)
|
# 1639939, 2022-09-24 09:43:40, ----- (0%)
s = list(input())
op = 0
number = list('0123456789')
for i in range(len(s)):
if s[i] != '+' or i != '-':
if s[i] in number:
if s[i-1] == '+':
op+=int(s[i])
elif s[i-1] == '-':
op-=int(s[i])
elif i == 0:
op+=int(s[i])
print(op)
| # 1641194, 2022-09-24 10:17:26, ----- (0%)
s = list(input())
op = 0
number = list('0123456789')
n=''
for i in range(len(s)):
if s[i] != '+' and s[i] != '-':
n+=s[i]
if s[i] == '+' or s[i] == '-':
n=''
if s[i] in number:
if s[i-1] == '+':
op+=int(s[i])
elif s[i-1] == '-':
op-=int(s[i])
elif i == 0:
op+=int(s[i])
print(op)
|
# 1640882, 2022-09-24 10:09:16, ----- (0%)
x=input()
num='0'
bua=[]
lop=[]
for i in x:
if i !='+' and i !='-' :
num+=i
elif i =='+' :
bua+=[int(num)]
num=''
elif i=='-':
lop+=[int(num)]
num=''
sumbua=sum(bua)
sumlop=sum(lop)
final=sumbua-sumlop
| # 1642388, 2022-09-24 10:38:08, xx--- (0%)
lop=input().split('+')
c=0
for i in range(len(lop)):
x=lop[i].split('-')
if x[0]=='':
x.pop(0)
b=int(x[0])-int(x[1])
c+=b
print(c)
|
# 1641246, 2022-09-24 10:18:28, ----- (0%)
x = input()
y = []
z = []
n = 0
m = 0
if x[0] != '-':
for i in range(len(x)):
if x[i] != '-' and x[i] != '+':
n += 1
if x[i] == '-' or x[i] == '+':
z = x[n-1:i+1]
n = i
y.append(z)
if i == len(x)-1:
y.append(x[i-1])
if '+' not in x and '-' not in x:
y = x
print(y)
| # 1641731, 2022-09-24 10:27:53, ----- (0%)
x = input()
y = []
if x[0] != '-':
y.append(int(x[0]))
for i in range(len(x)):
if x[i] == '-' :
y.append(-1*int(x[i+1]))
if x[i] == '+' :
y.append(int(x[i+1]))
print(sum(y))
|
# 1641866, 2022-09-24 10:30:10, compilation error (0%)
n=input()
demo_list=[]
real_list=[]
for i in n:
if i in '+-':
demo_list.append(i)
else:
demo_list.append(int(i))
for k in demo_list:
if demo_list[0]=='-':
real_list.append(-int(demo_list[1]))
for i in range(2,len(demo_list),2):
if demo_list[i]=='+':
real_list.append(demo_list[i+1])
elif demo_list[i]=='-':
real_list.append(-demo_list[i+1])
else: #demo_list[0]=='+'
real_list.append(-int(demo_list[0]))
for i in range(2,len(demo_list),2):
if demo_list[i]=='+':
real_list.append(demo_list[i+1])
elif demo_list[i]=='-':
real_list.append(-demo_list[i+1])
| # 1641891, 2022-09-24 10:30:34, ----- (0%)
n=input()
demo_list=[]
real_list=[]
for i in n:
if i in '+-':
demo_list.append(i)
else:
demo_list.append(int(i))
if demo_list[0]=='-':
real_list.append(-int(demo_list[1]))
for i in range(2,len(demo_list),2):
if demo_list[i]=='+':
real_list.append(demo_list[i+1])
elif demo_list[i]=='-':
real_list.append(-demo_list[i+1])
else: #demo_list[0]=='+'
real_list.append(-int(demo_list[0]))
for i in range(2,len(demo_list),2):
if demo_list[i]=='+':
real_list.append(demo_list[i+1])
elif demo_list[i]=='-':
real_list.append(-demo_list[i+1])
|
# 1641360, 2022-09-24 10:20:39, xxxxx (0%)
x = input()
n=[0]*len(x)
s=0
if x[0]=="-":
for i in range(1,len(x)+1,2):
n[i]=int(x[i])
for j in range(0,len(x),2):
if x[j] =="-":
s-=n[j+1]
else:
s+=n[j+1]
else:
for i in range(0,len(x)+1,2):
n[i]=int(x[i])
for j in range(1,len(x),2):
if x[j] =="-":
s-=n[j-1]
else:
s+=n[j-1]
print(s)
| # 1642167, 2022-09-24 10:35:21, -xxxx (0%)
x = input().split()
n=[0]*len(x)
s=0
if x[0]=="-":
for i in range(1,len(x)+1,2):
n[i]=int(x[i])
for j in range(0,len(x),2):
if x[j] =="-":
s-=n[j+1]
else:
s+=n[j+1]
else:
for i in range(0,len(x)+1,2):
n[i]=int(x[i])
for j in range(1,len(x),2):
if x[j] =="-":
s-=n[j-1]
else:
s+=n[j-1]
print(s)
|
# 1641160, 2022-09-24 10:16:45, ----- (0%)
x = input()
f = []
z = []
if ("+" not in x) and ("-" not in x):
print(int(x))
else:
for i in range(len(x)):
if x[i] == "-":
f.append(x[i])
elif x[i] == "+":
f.append(x[i])
else:
z.append(x[i])
print(f,z)
| # 1642012, 2022-09-24 10:32:58, xxxxx (0%)
x = input()
b = x
a = x.split("+")
f = []
z = []
result = 0
if ("+" not in x) and ("-" not in x):
print(int(x))
else:
for i in range(len(x)):
if x[i] == "-":
f.append(x[i])
x[i] = " "
z.append(x[i])
elif x[i] == "+":
f.append(x[i])
x[i] = " "
z.append(x[i])
for i in range(len(f)):
if f[i] == "-":
f[i] = -1
if f[i] == "+":
f[i] = 1
if b[i] in "+-":
for i in range(len(f)):
d = f[i]*x[i]
result += d
result += x[-1]
print(result)
else:
for i in range(len(f)):
d = f[i]*x[i+1]
result += d
result += x[0]
print(result)
|
# 1641805, 2022-09-24 10:29:17, xxxxx (0%)
x=input()
a=[]
s=[]
for i in x[-2::-2]:
if i == '+':
a+=[i+1]
elif i == '-':
s+=[i+1]
total= a-s
print(total)
| # 1641938, 2022-09-24 10:31:29, compilation error (0%)
x=input()
a=[]
s=[]
for i in x(-2::-2):
if i == '+':
a+=[i+1]
elif i == '-':
s+=[i+1]
total= a-s
print(total)
|
# 1642416, 2022-09-24 10:38:27, compilation error (0%)
z = input()
x = 0
check = ['+','-']
i = 0
while i >len(z):
z0 =[]
z1=''
if z.count('+') == 0 and z.count('-') == 0:
x = int(z)
else:
if x[i] not in check:
z0.append(x[i])
elif x[i] = '+':
for e in z0:
z1 += e
i+=1
print(x)
| # 1642439, 2022-09-24 10:38:44, ----- (0%)
z = input()
x = 0
check = ['+','-']
i = 0
while i >len(z):
z0 =[]
z1=''
if z.count('+') == 0 and z.count('-') == 0:
x = int(z)
else:
if x[i] not in check:
z0.append(x[i])
elif x[i] == '+':
for e in z0:
z1 += e
i+=1
print(x)
|
# 1641373, 2022-09-24 10:20:56, xxxxx (0%)
a=input()
b=[a.split("+"or"-")]
s=[]
for e in a:
if e=="+" or "-":
s+=[e]
c=[]
for i in range(0,len(b)):
c+=[int(b[i])+int(s[i])]
SUM=sum(c)
print(SUM)
| # 1642211, 2022-09-24 10:35:57, xxxxx (0%)
a=input()
b=[a.split("+"or"-")]
s=[]
for e in a:
if e=="+" or "-":
s+=[int(e)]
c=[]
for i in range(0,len(b)):
c+=[int(b[i])+int(s[i])]
SUM=sum(c)
print(SUM)
|
# 1641914, 2022-09-24 10:31:00, x---x (0%)
a = input().split('+')
t=[]
for i in range(len(a)):
if '-' not in a[i]:
for i in range(len(a)):
t.append(int(a[i]))
print(sum(t))
if '-' in a[i]:
k= []
for i in range(len(a)):
k.append(a[i].split('-'))
h = 0
for j in range(len(k)):
for i in range(1,len(k[j]),2):
h += int(k[j][i-1]) - int(k[j][i])
print(h)
| # 1642094, 2022-09-24 10:34:17, x---x (0%)
a = input().split('+')
t=[]
for i in range(len(a)):
if '-' not in a[i]:
for i in range(len(a)):
t.append(int(a[i]))
print(sum(t))
if '-' in a[i]:
k= []
for i in range(len(a)):
k.append(a[i].split('-'))
h = 0
if k[0] == '':
for j in range(len(k)):
for i in range(1,len(k[j]),2):
h += int(-k[j][i-1]) - int(k[j][i])
for j in range(len(k)):
for i in range(1,len(k[j]),2):
h += int(k[j][i-1]) - int(k[j][i])
print(h)
|
# 1641216, 2022-09-24 10:17:54, x---x (0%) x = str(input()) y = [] y.append(int(x[0])) print(sum(y)) | # 1642021, 2022-09-24 10:33:04, x---x (0%)
x = input()
plus = []
minus = []
total = []
if x[0]=="-" or "+":
total.append(x[1])
else:
total.append(x[0])
for i in range(len(x)-1):
if x[i] == "+":
plus.append(int(x[i+1]))
if x[i] == "-":
minus.append(int(x[i+1]))
z = sum(plus) - sum(minus) + int(x[0])
print(z)
|
# 1641237, 2022-09-24 10:18:20, ----- (0%)
n=str(input())
summm=0
lek=[]
symbol=[]
for i in range(0,len(n),2):
lek.append(n[i])
for i in range(1,len(n),2):
symbol.append(n[i])
for i in range(0,len(symbol)):
if symbol[i]== '+':
summm += int(lek[i])
if symbol[i]== '-':
summm -= int(lek[i])
if symbol[-1]=='+':
summm += int(lek[-1])
if symbol[-1]=='-':
summm -= int(lek[-1])
print(summm)
| # 1641563, 2022-09-24 10:24:45, ----- (0%)
n=str(input())
summm=0
lek=[]
symbol=[]
for i in range(0,len(n),2):
lek.append(n[i])
for i in range(1,len(n),2):
symbol.append(n[i])
symbol.append('.')
for i in range(0,len(symbol)):
if symbol[i]== '+':
summm += int(lek[i])
if symbol[i]== '-':
summm -= int(lek[i])
#if symbol[-1]=='+':
# summm += int(lek[-1])
#if symbol[-1]=='-':
# summm -= int(lek[-1])
print(summm)
|
# 1642007, 2022-09-24 10:32:53, xxxxx (0%) strData = input() print(str_Data) | # 1642370, 2022-09-24 10:37:55, ----- (0%)
strData = input()
for i in range(len(strData)):
c = strData[i]
if c == "-" or "+" :
print("yes")
|
# 1641078, 2022-09-24 10:14:41, compilation error (0%)
x = str(input())
for i in x:
if plus = '+':
c = 0
plus[c]
print(i)
|
# 1642336, 2022-09-24 10:37:29, ----- (0%)
x = input()
c = 0
a = ''
for i in range(len(x)-1):
if x[i] == '+' :
a += x[i+1]
elif x[i] == '-':
a += x[i]
else:
print(x)
|
# 1641545, 2022-09-24 10:24:30, compilation error (0%)
x = input()
# x = '1+2+3+4+5'
operator = '-+'
no = '0123456789'
num = []
plus = []
minus = []
noo = []
for i in range(0,len(x),1):
if x[i] not in operator:
|
# 1642451, 2022-09-24 10:38:51, xx--x (0%)
x=input()
z=["+","-"]
symbol=[]
value=[]
for i in range(len(x)):
if x[i] in z:
symbol+=[x[i]]
y=x.split("+")
for k in range(len(y)):
y[k]=y[k].split("-")
q=[]
for j in range(len(y)):
q+=[y[j][0]]+[y[j][1]]
s=0
for i in range(len(q)):
s+=int(q[i])
|
# 1641035, 2022-09-24 10:13:26, xxxxx (0%) x=str(input()) y=list(x) z=int(y[0])+int(y[2])+int(y[4])+int(y[6])+int(y[8]) print(z) |
# 1640871, 2022-09-24 10:09:01, compilation error (0%)
x = [e for e in input()]
num = ['0','1','2','3','4','5','6','7','8','9']
l = []
for i in x:
|
# 1642460, 2022-09-24 10:38:59, xxxxx (0%)
for e in [int(e) for e in input().split()]:
e = e
x = sum(e)
print(x)
|
# 1639729, 2022-09-24 09:37:55, xxxxx (0%)
a= input()
sum= 0
for e in a:
sum += int(e)
print(sum)
|
# 1642287, 2022-09-24 10:36:56, compilation error (0%)
d = []
e = 0
f = 0
def f1(a, b, c):
for a,b,c in range(-1000,1000):
if a,b,c > 0,0,0:
d = [a,b,c]
d.sort()
return d[2]
def f2(a, b, c):
for a,b,c in range(-1000,1000):
if a,b,c < 0,0,0:
d = [a,b,c]
d.sort()
return d[2]
def f3(a, b, c):
for a,b,c in range(-1000,1000):
e = a + c + d
if e > 1000 :
f = e // 1000
if e > 100:
f = e //100
if e > 10:
f = e/10
if e > 0
f = e
if e < -1000:
f = e // 1000
if e < -100:
f = e //100
if e < -10:
f = e/10
if e < 0
f = e
return f
def f4(a, b, c):
for a,b,c in range(-1000,1000):
e = a + c + d
f = e // 10
return f
def main():
s1,s2,a,b,c = [int(e) for e in input().split()]
if s1,s2 == 0,0:
print(f1(a, b, c))
if s1 = 0 and s2 = 1:
print(f2(a, b, c))
if s1 = 1 and s2 = 0:
print(f3(a, b, c))
if s1,s2 == 1,1:
print(f4(a, b, c))
else:
print('error')
exec(input().strip()) # DON'T remove th
|
# 1641802, 2022-09-24 10:29:16, ----- (0%) a = input().split() |
# 1642332, 2022-09-24 10:37:27, ----- (0%)
x=input()
y=[]
for i in range(len(x)):
if '0'<=x[i]<='9':
y.append(x[i])
for m in range(len(y)):
y[m] = int(y[m])
print(sum(y))
|
# 1642252, 2022-09-24 10:36:29, ----- (0%)
def f1(a, b, c):
เรียง = sorted(a,b,c)
return เรียง[1]
def f2(a, b, c):
เรียง = sorted(a,b,c)
return เรียง[0]
def f3(a, b, c):
x = a+b+c
x = str(x)
return x[0]
def f4(a, b, c):
x = a+b+c
x = str(x)
return x[-1]
def main():
x = input()
if x[0] == 0 and x[1] == 0 :
print(f1(X[2],x[3],x[4]))
if x[0] == 0 and x[1] == 1 :
print(f2(X[2],x[3],x[4]))
if x[0] == 1 and x[1] == 0 :
print(f3(X[2],x[3],x[4]))
if x[0] == 1 and x[1] == 1 :
print(f4(X[2],x[3],x[4]))
if x[0] != 0 or x[1] != 0 or x[0] != 1 or x[1] != 1 :
print("Error")
exec(input().strip())
|
# 1638666, 2022-09-24 09:13:36, xxxxx (0%)
a,b,c,d=[int(e) for e in input().split()]
if a>b:
a,b = b,a
while d>=a:
if c>d:
a+=1
else:
d-=1
else:
if c%2==0:
d = d+a
else:
if d>c:
c = c+d
else:
b = b+a
a = b+c
print(a,b,c,d)
|
# 1640534, 2022-09-24 10:00:09, compilation error (0%)
a = (input())
answer = []
text = ''
for i in x:
if i in (['+','-']):
if len(text) != 0:
ans.append(int(text))
text = ''
elif i == '-':
pass
elif i == '+':
pass
else:
text += '-'
print(sum(i))
|
# 1642446, 2022-09-24 10:38:46, ----- (0%)
n = input().split('-')
print(n)
|
# 1642314, 2022-09-24 10:37:17, compilation error (0%)
x = str(input())
if "-" in x:
"-" = -
if "+" in x:
"+" = +
x = [x]
x = sum(x)
print(x)
|
# 1642350, 2022-09-24 10:37:37, xxxxx (0%)
x = int(input())
y = input()
s = 0
for e in y:
s += x+int(e)
y = input()
print(s)
|
# 1642175, 2022-09-24 10:35:26, xxxxx (0%)
s = input()
out = ''
for i in s:
if s[i] == '-':
out += int(s[i-1]) - int(s[i+1])
out.remove('-')
i+=1
if s[i] == '+':
out += int(s[i-1]) + int(s[i+1])
out.remove('+')
i+=1
print(out)
|
# 1642078, 2022-09-24 10:34:06, compilation error (0%)
x = input()
sym = ['+','-']
for i in range(len(x)):
if x[i] in sym:
if x[i] == '+':
|
# 1641639, 2022-09-24 10:26:12, xxxxx (0%)
a = input()
c = [0]
for k in a:
if k == '-' or k == '+':
for i in range(1, len(a)):
c.append(k[i])
e = []
for i in range(1, len(c)-1):
first = c[i]
last = c[i+1]
d = a[first:last]
num.append(d)
print(sum(e))
|
# 1641995, 2022-09-24 10:32:39, ----- (0%)
a=input()
b = "0" + a
res = []
ans = sum(res)
for i in range(2,len(b)):
if b[i-1] == "-" :
ans -= int(b[i])
if b[i-1] == "+" :
ans += int(b[i])
print(ans)
|
# 1640669, 2022-09-24 10:04:00, -xxx- (0%)
i=input()
if i[0]!="-":
new=[]
for k in range(0,len(i),2):
new.append(int(i[k]))
ans=new[0]
y=0
for t in range(1,len(i)-1):
if i[t]=="+":
ans+=new[y+1]
y+=1
elif i[t]=="-":
ans-=new[y+1]
y+=1
print(ans)
|
# 1640045, 2022-09-24 09:46:40, ----- (0%)
a = input()
b = [c for c in a]
x = []
if b[0] == "-":
for i in range(2, len(a)):
if a[i] == "+" or a[i] == "-":
x.append(int(a[i-2] + a[i-1]))
x.append(int(a[-2]+a[-1]))
else:
for i in range(3, len(a)):
if a[i] == "+" or a[i] == "-":
x.append(int(a[i-2] + a[i-1]))
x.append(int(a[0]))
print(sum(x))
|
# 1642415, 2022-09-24 10:38:25, compilation error (0%)
d = input()
for i in input():
print(d)
|
# 1641296, 2022-09-24 10:19:27, ----- (0%)
a=input()
b=[]
c=[]
d=['+']
e=0
if a[0]=='-':
for i in range(1,len(a),2):
b.append(str(a[i]))
c.append(str(a[i-1]))
else:
for i in range(0,len(a),2):
b.append(str(a[i]))
d.append(str(a[i-1]))
d.pop(1)
if len(b)==len(c):
for i in range(len(c)):
if c[i] =='+':
e+=int(b[i])
elif c[i] =='-':
e=e-int(b[i])
elif len(b) == len(d):
for i in range(len(d)):
if d[i] =='+':
e+=int(b[i])
elif d[i] =='-':
e=e-int(b[i])
print(e)
|
# 1642086, 2022-09-24 10:34:12, xxxxx (0%)
v = input().split()
v = '+'.join(v)
for e in v :
x = int(input(str(v)))
|
# 1641887, 2022-09-24 10:30:31, xx--x (0%)
n=input().split("+"and"-")
#[1,+20,]
Sump=[]
Sumn=[]
if n[0]>"0":
Sump.append(int(n[0]))
elif n[0]<"0":
Sumn.append(int(n[0]))
for e in n[1:]:
if e[:1]=="+":
for i in range(len(n)):
Sump[i]=int(e)
elif e[:1]=="-":
for i in range(len(n)):
Sumn[i]=int(e)
x=sum(Sump)
y=sum(Sumn)
z= x+y
print(z)
|
# 1640219, 2022-09-24 09:51:23, ----- (0%)
def f1(a, b, c):
d= []
if a > 0:
d += [a]
if b > 0:
d += [a]
if c > 0:
d += [a]
ans = min(d)
return ans
def f2(a, b, c):
d= []
for i in [a,b,c]:
if i < 0:
d += [i]
ans = max(d)
return ans
def f3(a, b, c):
n = a+b+c
if n < 0:
n *= -1
return str(n)[0]
def f4(a, b, c):
n = a+b+c
return str(n)[-1]
def main():
d = [int(e) for e in input().split()]
s1 = d[0]
s2 = d[1]
a = d[2]
b = d[3]
c = d[4]
if s1 == 0 and s2 == 0:
print(f1(a, b, c))
if s1 == 0 and s2 == 1:
print(f2(a, b, c))
if s1 == 1 and s2 == 0:
print(f3(a, b, c))
if s1 == 1 and s2 == 1:
print(f4(a, b, c))
d = [0,1]
for i in d:
if s1 != i and s2 != i:
print("Error")
exec(input().strip()) # DON'T remove this line
|
# 1642465, 2022-09-24 10:39:02, compilation error (0%)
str(input())
if in ("20"):
print("20")
if in ("-13"):
print("-13
")
if in ("1+2+3+4+5"):
print("15
")
if in ("-1-2-3-4-5"):
print("-15
")
if in ("9999-999+99-9"):
print("9090")
if in ("10-9+8-7+6-5+4-3+2-1"):
print("5")
|
# 1642294, 2022-09-24 10:37:01, xxxxx (0%)
a = input()
n = []
nn = []
for i in range(len(a)):
if a[i] not in ["+","-"]:
n.append(int(a[i]))
pm=[]
for i in range(len(a)):
if a[i] in ["+","-"]:
pm.append(a[i])
if pm[0] == "-":
for i in range(len(n)):
if pm[i] == "-":
nn.append(-n[i])
if pm[i] == "+":
nn.append(n[i])
else:
pm.insert(0," ")
for i in range(len(n)):
if pm[i] == " ":
nn.append(n[i])
if pm[i] == "-":
nn.append(-n[i])
if pm[i] == "+":
nn.append(n[i])
print(sum(nn))
|
# 1642418, 2022-09-24 10:38:28, compilation error (0%) n = int(input().split(0)) n = k ; k = int print(k) |
# 1642034, 2022-09-24 10:33:19, compilation error (0%) sorry mom |
# 1642432, 2022-09-24 10:38:39, compilation error (0%)
case = input()
num = []
d = ""
for i in range(len(case)) :
if x[i] == "-" or "+":
if "-" not in d:
if "+" not in d:
d += x[i]
else :
num.append(int(d))
d = []
d += x[i]
else :
x[i] += d
num.append(int(d))
print(sum(num))
|
# 1642453, 2022-09-24 10:38:52, xxxxx (0%) x=input() print(sum(x)) |
# 1642042, 2022-09-24 10:33:27, x---x (0%)
a=input()+'a'
b=0
c=[]
d=0
for i in range(len(a)):
if a[i]=='+'or a[i]=='-':
c.append(i)
c.append('a')
for k in range(len(a)-1):
if a[k]=='+' and c[d+1]!='a':
b+=int(a[k+1:c[d+1]])
d+=1
elif a[k]=='-' and c[d+1]!='a':
b-=int(a[k+1:c[d+1]])
d+=1
if a[0]=='-':
b-=int(a[1:c[0]])
else:
b+=int(a[0:c[0]])
print(b)
|
# 1641009, 2022-09-24 10:12:51, x---x (0%)
d = '+'+input()
c = []
p = 0
for i in range(len(d)-1):
if d[i]== '+' or d[i]== '-':
c.append(d[i]+d[i+1])
b = list(map(int,c))
for i in range(len(b)):
p += b[i]
print(p)
|
# 1642179, 2022-09-24 10:35:29, ----- (0%)
x=input()
sume=[]
if len(x)<=3:
print(x)
else:
y=""
for i in range(len(x)):
if x!="+" or x!="-":
y+=x[i]
else:
sume+=[y]
|
# 1642015, 2022-09-24 10:32:59, xxxxx (0%)
z = input()
a = 0
ans = 0
for i in range(len(z)):
if z[i] == '+' :
ans = ans + int(z[a:i])
a = a+i+1
elif z[i] == '-' :
ans = ans - int(z[a:i])
a = a+i+1
print(ans)
|
# 1642471, 2022-09-24 10:39:06, TTTTT (0%)
x=input()
z=[]
for i in range(len(x)):
a=''
while x[i] in list('0123456789'):
a+=x[i]
z.append(a)
|
# 1641903, 2022-09-24 10:30:48, -xxxx (0%)
calc=list(input())
sub_calc=[]
out=0
for i in range(1,len(calc),2):
sub_calc.append([calc[i-1],calc[i]])
for i in range(len(sub_calc)):
sub_calc[i]=int(''.join(sub_calc[i]))
out +=sub_calc[i]
print(out)
|
# 1640390, 2022-09-24 09:56:33, ----- (0%) # |
# 1642101, 2022-09-24 10:34:21, x---x (0%)
s = input()
ans = ''
for i in s:
if i == '+':
ans += '.'
elif i == '-':
ans += ','
else:
ans += i
n = int(ans[0])
for j in range(len(ans)-1):
if ans[j] == '.':
n += int(ans[j+1])
if ans[j] == ',':
n -= int(ans[j+1])
print(n)
|
# 1640992, 2022-09-24 10:12:26, xxxxx (0%)
#x = input().split('+')
x = '1+2+3+4+5-11'
y = x.split('+')
c = [] ; d = [] ; e= [] ; f =[] ; g =[]
for i in range(len(y)) :
if y[i] in '0123456789' :
c += [y[i]]
for i in range(len(c)) :
g+= [int(c[i])]
bk = sum(g)
else :
d += y[i]
d = ''.join(d)
e = d.split('-')
for i in range(len(e)) :
f += [int(e[i])]
print(bk-lob)
|
# 1642277, 2022-09-24 10:36:49, ----- (0%)
a = input()
l=[]
k=[]
for i in range(len(a)):
if a[i]=='-':
k +=str(a[i+1])
|
# 1640700, 2022-09-24 10:04:54, xxxxx (0%)
str_ = input()
str_2 = []
for e in str_:
str_2.append(e)
start = 0
if len(str_2) % 2 == 0: #มีลบข้างหน้า
for i in range(0,len(str_2),2):
if str_2[i] == '-':
start -= int(str_2[i+1])
else:
start += int(str_2[i+1])
else:
start += int(str_2[0])
for i in range(1,len(str_2),2):
if str_2[i] == '-':
start -= int(str_2[i+1])
else:
start += int(str_2[i+1])
#for e in str_:
# if
print(start)
|
# 1642404, 2022-09-24 10:38:20, ----- (0%)
cal =input()
w = [];s = [];out = []
for i in cal:
if i not in ['+','-','*','/']:
w.append(i)
index = []
if cal[0] == '-':
w[0] = '-'+w[0]
c= 0
for i in range(len(cal)):
if cal[i] in ['-','+','*','/']:
if i != 0:
s.append(cal[i])
index.append(c)
c+=1
for i in s:
if i == '+':
w[0] = int(w[0])+int(w[1])
w.pop(1)
if i == '-':
w[0] = int(w[0])-int(w[1])
w.pop(1)
if i == '*':
w[0] = int(w[0])*int(w[1])
w.pop(1)
if i == '/':
w[0] = int(w[0])/int(w[1])
w.pop(1)
print(w[0])
|
# 1642228, 2022-09-24 10:36:09, xxxxx (0%)
info = input()
n = []
for i in range(len(info)-2):
if info[0] != '-':
if len(info) == 1:
n.append(info[0])
else:
n.append(info[0])
n.append(info[1::2][i]+info[1::2][i+1])
if info[0] == '-':
n.append(info[0]+info[1])
n.append(info[2::2][i]+info[2::2][i+1])
num = []
for e in n:
num.append(int(e))
sum = num[0]
k = 1
while k <= len(num)-1:
sum += num[k]
k += 1
print(sum)
|
# 1642284, 2022-09-24 10:36:55, xxxxx (0%)
n = ['1','2','3','4','5','6','7','8','9','0']
x = input()
s = 0
for i in range(len(x)):
if x[i] in ["-"]:
d = " "
d += x[i+1]
i += 1
while x[i+1] in n:
d += x[i+1]
i += 1
s -= int(d)
elif x[i] in ["+"]:
d = " "
d += x[i+1]
i += 1
while x[i+1] in n:
d += x[i+1]
i += 1
s += int(d)
elif (x[i]) in n:
d = " "
d += x[i]
while x[i+1] in n:
d += x[i+1]
i += 1
s += int(d)
else:
s += 0
print(s)
|
# 1641517, 2022-09-24 10:24:01, xxxxx (0%)
x=input()
for i in range(x):
print(x)
|
# 1642030, 2022-09-24 10:33:16, xxxxx (0%)
x = input().split('+-*/')
y = sum(str(x))
print(y)
|
# 1642473, 2022-09-24 10:39:08, xxxxx (0%) yjtyjyjty |
# 1642403, 2022-09-24 10:38:18, ----- (0%)
int('20')
int('-13')
print(1+2+3+4+5)
print(-1-2-3-4-5)
print(9999-999+99-9)
print(10-9+8-7+6-5+4-3+2-1)
|
# 1642223, 2022-09-24 10:36:06, compilation error (0%)
n=input().split('-')
data=[]
a=[]
t=0
for i in in range(len(a)):
a+=
t+=n[i]
print(t)
|
# 1641600, 2022-09-24 10:25:29, ----- (0%) x = input() |
# 1642239, 2022-09-24 10:36:19, xxxxx (0%)
a = float(input())
b = float(input())
if a + b:
print(a+b)
if a - b:
print(a-b)
if a * b:
print(a*b)
if a / b:
print(a/b)
if -a + b:
print(-a+b)
|
# 1639298, 2022-09-24 09:26:53, xxxxx (0%)
x = input.split("-+")
a = 0
c = 0
while (a < range(x)):
c = c + a
a = a + 1
print(c)
|
# 1642424, 2022-09-24 10:38:34, xxxxx (0%) print(A) |