import re
def Main():
s=int(input())
pat=re.compile(r'(^\+|-|\(\+\d)')
for i in range(s):
t=input()
if pat.search(t) is not None:
print("ERROR")
else:
try:
print(eval(t))
except:
print("ERROR")
if __name__=="__main__":
Main()
def Main():
s=int(input())
pat=re.compile(r'(^\+|-|\(\+\d)')
for i in range(s):
t=input()
if pat.search(t) is not None:
print("ERROR")
else:
try:
print(eval(t))
except:
print("ERROR")
if __name__=="__main__":
Main()
Comments
Post a Comment