Problem:

Simple Calculator

Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.

The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Input

The input consists of multiple datasets. Each dataset is given in the following format.

a op b

The input ends with a dataset where op = '?'. Your program should not process for this dataset.

Output

For each dataset, print the value in a line.

Constraints

  
 0 ≤ a, b ≤ 20000

No divisions by zero are given.

Sample Input 1

1 + 2
56 - 18
13 * 2
100 / 10
27 + 81
0 ? 0

Sample Output 1

3
38
26
10
108



Sample input:
1 + 2
56 - 18
13 * 2
100 / 10
27 + 81
0 ? 0


Sample output:
3
38
26
10
108

Submission status: Runtime Error

Solution code:
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.remove("0 ? 0")
for st in a:
    print("{0}".format(calc(st)))

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 b=eval(s.split().join())
 print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 b=al(''.join(s.split()))
 print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]="/":
  print(t[0]//[1])
 else:
  b=eval(''.join(t))
  print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=="/":
  print(t[0]//[1])
 else:
  b=eval(''.join(t))
  print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=="/":
  print(t[0]//t[1])
 else:
  print(eval(''.join(t)))

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=="/":
  print(t[0]//t[2])
 else:
  print(eval(''.join(t)))

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split(' ')
 if t[1]=='/':
  print(t[0]//t[2])
 else:
  print(eval(''.join(t)))

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=='/':
  print(t[0]//t[2])
 else:
  b=eval(''.join(t))
  print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=='/':
  print(int(t[0])//int(t[2]))
 else:
  b=eval(''.join(t))
  print(b)

Submission status: Runtime Error

Solution code:
a=[]
while True:
 n=input()
 if n.find('?')>0:break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=='/':print(int(t[0])//int(t[2]))
 else:print(eval(''.join(t))

Submission status: Runtime Error

Solution code:
while True:
    a,op,b = map(str,input().split())
    a = int(a)
    b = int(b)
    
    if a == 0 and b == 0 and op == '?':
        break
    
    if op == '+':
        print('{}'.format(a+b))
    elif op == '-':
        print('{}'.format(a-b))
    elif op == '*':
        print('{}'.format(a*b))
    else :print('{}'.format(int(a/b)))

Submission status: Runtime Error

Solution code:
x,b,z = input().split()
a=int(x)
c=int(z)
while b!="?":
    if b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(a/c)
    a,b,c = input().split()

Submission status: Runtime Error

Solution code:
x,b,z = input().split()
a=int(x)
c=int(z)
while b!="?":
    if b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(int(a/c))
    a,b,c = input().split()

Submission status: Runtime Error

Solution code:
x,b,z = input().split()
a=int(x)
c=int(z)
while b!="?":
    if b=="+":
        print(a+c)
    elif b=="-":
        print(int(a)-int(c))
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(int(a/c))
    a,b,c = input().split()

Submission status: Runtime Error

Solution code:
# coding:utf-8
while True:
    line = raw_input().split()
    a = int(line[0])
    op = line[1]
    b = int(line[2])
    answer = 0
    if op == '+':
        answer = a + b
    elif op == '-':
        answer = a - b
    elif op == '*':
        answer = a * b
    elif op == '/':
        answer = a / b
    elif op == '?' and a == 0 and b == 0:
        break
    print "%d" % answer

Submission status: Runtime Error

Solution code:
while True:s = int(input())
    if '?' in s:break
    print(eval(s))

Submission status: Runtime Error

Solution code:
import sys

l = []
for input in sys.stdin:
    l.append(input.split())
for i in range(0,len(l)):
    if(l[i][1] == '+'):
        print int(l[i][0])+int(l[i][2])
    elif(l[i][1] == '-'):
        print int(l[i][0])-int(l[i][2])
    elif(l[i][1] == '*'):
        print int(l[i][0])*int(l[i][2])
    elif(l[i][1] == '/'):
        print int(l[i][0])/int(l[i][2])
    else:
        continue

Submission status: Runtime Error

Solution code:
while True:
	try:
		line = input()
		if line == '0 ? 0':
			break	
		else:
			a,op,b = line.split(' ')
			if op == '+':
				print(int(a)+int(b))
			if op == '-':
				print(int(a)-int(b))
			if op == '*':
				print(int(a)*int(b))
			if op == '/':
				print(int(float(a)/float(b)))
	except EOFError:
		break

Submission status: Runtime Error

Solution code:
while(1):
    x = raw_input()
    x = x.split(" ")
    if(x == "0 ? 0"):
        break
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b

Submission status: Runtime Error

Solution code:
while(1):
    x = raw_input()
    x = x.split(" ")
    if(x == "0 ? 0"):
        break
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b

Submission status: Runtime Error

Solution code:
from sys import stdin
for line in stdin:
	if line == '0 ? 0':
		break
	tmp = line.strip('\n').split(' ')
	a, b = int(tmp[0]), int(tmp[-1])
	if tmp[1] == '+':
		print(a + b)
	elif tmp[1] == '-':
		print(a - b)
	elif tmp[1] == '*':
		print(a * b)
	elif tmp[1] == '/':
		print(a // b)

Submission status: Runtime Error

Solution code:
a, op, b = input().split()

ans = int(a) op int(b)

print(ans)

Submission status: Runtime Error

Solution code:
while(True) :
    instr=input()
    if(instr=='?') break;
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    else :
        print("{}".format(int(a/b)))

Submission status: Runtime Error

Solution code:
while(True) :
    instr=input()
    if(instr=='?') : break;
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    else :
        print("{}".format(int(a/b)))

Submission status: Runtime Error

Solution code:
while(True) :
    instr=input()
    if(instr=='?') : break
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    else :
        print("{}".format(int(a/b)))

Submission status: Runtime Error

Solution code:
while(True) :
    instr=input()
    if(instr=='?') :
        break
    a,op,b=instr.split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    else :
        print("{}".format(int(a/b)))

Submission status: Runtime Error

Solution code:
while True:
	a,op,b = input().split()
	if op = '+':
		print(a+b)
	if op = '-':
		print(a-b)
	if op = '*':
		print(a*b)
	if op = '/':
		print(a/b)
	if op = '?':
		break

Submission status: Runtime Error

Solution code:
a,op,b=input()

if op=='+':
  print(int(a)+int(b))

if op=='-':
  print(a-b)
  
elif op=='*':
  print(a*b)

elif op=='/':
  print(a/b)

Submission status: Runtime Error

Solution code:
while True:
  a,op,b=input()

  if op=='+':
    print(int(a)+int(b))

  if op=='-':
    print(a-b)

  elif op=='*':
    print(a*b)

  elif op=='/':
    print(a/b)

  elif op=='?':
    break

Submission status: Runtime Error

Solution code:
while(True):
    a, op, b = input().spilt
    a = int(a)
    b = int(b)
    if(op == '+'):
        print(a+b)
    elif(op == '-'):
        print(a-b)
    elif(op == '*'):
        print(a*b)
    elif(op == '/'):
        print(a//b)
    elif(op == '?'):
        break

Submission status: Runtime Error

Solution code:
while(True):
    a, op, b = input().spilt()
    a = int(a)
    b = int(b)
    if(op == '+'):
        print(a+b)
    elif(op == '-'):
        print(a-b)
    elif(op == '*'):
        print(a*b)
    elif(op == '/'):
        print(a//b)
    elif(op == '?'):
        break

Submission status: Runtime Error

Solution code:
while(True):
    a, op, b = map(input().spilt())
    a = int(a)
    b = int(b)
    if(op == '+'):
        print(a+b)
    elif(op == '-'):
        print(a-b)
    elif(op == '*'):
        print(a*b)
    elif(op == '/'):
        print(a//b)
    elif(op == '?'):
        break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
        op=str(op        
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(str,input().split())
        a=int(a)
        b=int(b)
           
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(str,input().split())
        a=float(a)
        b=float(b)
          
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=float(a)
        b=float(b)
          
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

Submission status: Runtime Error

Solution code:


while 1:
     s==input()
     if '?' in s: break
     print(int(eval(s)))

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
        op=str(op        
        if op==("+"):
                print(a+b)
        elif op==("-"):
                print(a-b)
        elif op==("*"):
                print(a*b)
        elif op==("/"):
                print(a/b)
        elif op==("?"):
                break

~

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
                
        if op==("+"):
                print(a+b)
        elif op==("-"):
                print(a-b)
        elif op==("*"):
                print(a*b)
        elif op==("/"):
                print(a/b)
        elif op==("?"):
                break

~

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
                
        if op==('+'):
                print(a+b)
        elif op==('-'):
                print(a-b)
        elif op==('*'):
                print(a*b)
        elif op==('/'):
                print(a/b)
        elif op==('?'):
                break

~

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
                
        if op==('+'):
                print(a+b)
        elif op==('-'):
                print(a-b)
        elif op==('*'):
                print(a*b)
        elif op==('/'):
                print(a/b)
        elif op==('?'):
                break

Submission status: Runtime Error

Solution code:
while 1:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
                
        if op==('+'):
                print(a+b)
        elif op==('-'):
                print(a-b)
        elif op==('*'):
                print(a*b)
        elif op==('/'):
                print(a/b)
        elif op==('?'):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=input().split()
        a=int(a)
        b=int(b)
        op=str(op        
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

~

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=input().split()
        a=int(a)
        b=int(b)
            
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=input().split()
        a=int(a)
        b=int(b)
            
        if op=('+'):
                print(a+b)
        elif op=('-'):
                print(a-b)
        elif op=('*'):
                print(a*b)
        elif op=('/'):
                print(a/b)
        elif op=('?'):
                break

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=input().split()
        a=int(a)
        b=int(b)
            
        if '?' in op: break
        print(eval(a+op+b))

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
            
        if '?' in op: break
        print(eval(a+op+b))

Submission status: Runtime Error

Solution code:
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)    
        if op=("+"):
                print(a+b)
        elif op=("-"):
                print(a-b)
        elif op=("*"):
                print(a*b)
        elif op=("/"):
                print(a/b)
        elif op=("?"):
                break

~

Submission status: Runtime Error

Solution code:
while True:
	l=input()
	if l[1]=='?':
		break
	print(eval(l))

Submission status: Runtime Error

Solution code:
while True:
    a, b, c = input().split()
    if b == '?':
        break
    a = int(a)
    c = int(c)
    if b == '+':
        print(a + b)
    if b == '-':
        print(a - b)
    if b == '*':
        print(a * b)
    if b == '/':
        print(a / b)

Submission status: Runtime Error

Solution code:
while Ture:
x=input().split()
a=int(x[0])
op=x[1]
b=int(x[2])
if op=="+":
  print(a+b)
elif op=="-":
   print(a-b)
elif op=="*":
   print(a*b)
elif op=="/":
   print(a/b)
else:
     break

Submission status: Runtime Error

Solution code:
while True:
x=input().split()
a=int(x[0])
op=x[1]
b=int(x[2])
if op=="+":
  print(a+b)
elif op=="-":
   print(a-b)
elif op=="*":
   print(a*b)
elif op=="/":
   print(a/b)
else:
    break

Submission status: Runtime Error

Solution code:
x=input().split(" ")
a=int(x[0])
op=x[1]
b=int(x[2])
if op=="+":
  print(a+b)
elif op=="-":
   print(a-b)
elif op=="*":
   print(a*b)
elif op=="/":
   print(a/b)
else:
    break

Submission status: Runtime Error

Solution code:
while True:
    x=input().split()
    a=int(x[0])
    op=x[1]
    b=int(x[2])
    if op =="+":
      print(a+b)
    elif op=="-":
       print(a-b)
    elif op=="*":
       print(a*b)
    eilf op=="/":
       print(a/b)
    else:
         break

Submission status: Runtime Error

Solution code:
 while True:
      x=input().split()
      a=int(x[0])
      op=x[1]
      b=int(x[2])
      if op =="+":
        print(a+b)
      elif op=="-":
          print(a-b)
      elif op=="*":
          print(a*b)
      elif op=="/":
          print(a/b)
      else:
         break

Submission status: Runtime Error

Solution code:
 while True:
      x=input().split(" ")
      a=int(x[0])
      op=x[1]
      b=int(x[2])
      if op =="+":
        print(a+b)
      elif op=="-":
          print(a-b)
      elif op=="*":
          print(a*b)
      elif op=="/":
          print(a/b)
      elif op =="?":
         break

Submission status: Runtime Error

Solution code:
 while True:
      x=input().split(" ")
      a=int(x[0])
      op=x[1]
      b=int(x[2])
      if (op =="+"):
        print(a+b)
      elif (op=="-"):
          print(a-b)
      elif (op=="*"):
          print(a*b)
      elif (op=="/"):
          print(a/b)
      elif (op =="?"):
         break

Submission status: Runtime Error

Solution code:
a,o,b = input().split()
a,b = map(int,(a,b))
print(a+b if o=='+': else a-b if o=='-': else a*b if o=='*': else a/b)

Submission status: Runtime Error

Solution code:
while 1:
  a,o,b = input().split()
  if o=='?': break
  a,b = int(a,b)
  print(a+b if o=='+' else a-b if o=='-' else a*b if o=='*' else a//b)

Submission status: Runtime Error

Solution code:
a,op,b=input().split()
if op=+:
	s=int(a)+int(b)
elif op=-:
	s=int(a)-int(b)
elif op=*:
	s=int(a)*int(b)
elif op=/:
	s=int(a)//int(b)
else:
	print(s)

Submission status: Runtime Error

Solution code:
while True:
	a,op,b=input().split()
	if op ="+":
		s=int(a)+int(b)
	elif op "-":
		s=int(a)-int(b)
	elif op ="*":
		s=int(a)*int(b)
	elif op ="/":
		s=int(a)//int(b)
	else:
		break
	print(s)

Submission status: Runtime Error

Solution code:
while 1:
	a,op,b=input().split()
	if op ="+":
		s=int(a)+int(b)
	elif op "-":
		s=int(a)-int(b)
	elif op ="*":
		s=int(a)*int(b)
	elif op ="/":
		s=int(a)//int(b)
	else:
		break
	print(s)

Submission status: Runtime Error

Solution code:
S=int(input())
print(S//3600,S//60%60,S%60,sep=":")

Submission status: Runtime Error

Solution code:
while True:
	a,op,b=map(str,input()split())
	if op == "+":
		s=int(a)+int(b)
	elif op =="-":
		s=int(a)-int(b)
	elif op =="*":
		s=int(a)*int(b)
	elif op =="/":
		s=int(a)//int(b)
	else:
		break
print(s)

Submission status: Runtime Error

Solution code:
ary = input().split()

if ary[1] = "+" :
    ans = int(ary[0]) + int(ary[2])

if ary[1] = "-" :
    ans = int(ary[0]) - int(ary[2])

if ary[1] = "*" :
    ans = int(ary[0]) * int(ary[2])

if ary[1] = "/" :
    ans = int(ary[0]) / int(ary[2])

print(ans)

Submission status: Runtime Error

Solution code:
while True:

    ary = input().split()

    if ary[1] = "?" :
        break

    if ary[1] = "+" :
        ans = int(ary[0]) + int(ary[2])

    if ary[1] = "-" :
        ans = int(ary[0]) - int(ary[2])

    if ary[1] = "*" :
        ans = int(ary[0]) * int(ary[2])

    if ary[1] = "/" :
        ans = int(ary[0]) / int(ary[2])

    print(ans)

Submission status: Runtime Error

Solution code:
while 1:
 a,b,c = map(str,input().split())
 a,c =int(a),int(c)
 if b =='+':
	print(a+c)
 elif b == '-' : print(a-c)
 elif b == '*' : print(a*c)
 elif b == '/' : print(a/c)
 else : break

Submission status: Runtime Error

Solution code:
while True :
s= raw_input
a, op, b = s.split()
if op == ? : break
print eval(s)

Submission status: Runtime Error

Solution code:
while 1 :
s= raw_input
a, op, b = s.split()
if op == ? : break
print eval(s)

Submission status: Runtime Error

Solution code:
while True :
 s = raw.input()
 a, op, b = s.split()
 if op == ? : break
 print eval(s)

Submission status: Runtime Error

Solution code:
while True :
      s= raw_input
      a, op, b = s.split()
      if op == ? : break
      print eval(s)

Submission status: Runtime Error

Solution code:
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])

def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        a = a[0]; op = a[1]; b = a[2]
        if op == "+": print(a + b)
        elif op == "-": print(a - b)
        elif op == "*": print(a * b)
        elif op == "/": print(a // b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])
    return a
 
def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        a = a[0]; op = a[1]; b = a[2]
        if op == "+": print(a + b)
        elif op == "-": print(a - b)
        elif op == "*": print(a * b)
        elif op == "/": print(a // b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def calc(a):
    if a[1]=="+": return int(a[0])+int(a[2])
    if a[1]=="-": return int(a[0])-int(a[2])
    if a[1]=="/": return int(a[0])/int(a[2])

res=[]
while 1:
    b=raw_input().split()
    if b[1]=="?":break
    res.append([calc(b)])
[print(i) for i in res]

Submission status: Runtime Error

Solution code:
def calc(a):
    if a[1]=="+": return int(a[0])+int(a[2])
    if a[1]=="-": return int(a[0])-int(a[2])
    if a[1]=="/": return int(a[0])/int(a[2])
res=[]
while 1:
    b=raw_input().split()
    if b[1]=="?":break
    res.extend([calc(b)])
[print(i) for i in res]

Submission status: Runtime Error

Solution code:
def calc(a):
    if a[1]=="+": return int(a[0])+int(a[2])
    if a[1]=="-": return int(a[0])-int(a[2])
    if a[1]=="/": return int(a[0])/int(a[2])
res=[]
while 1:
    b=raw_input().split()
    if b[1]=="?":break
    res.extend([calc(b)])
for i in res:
    print(i)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8

while True:
   A = raw_input().split()
   if A[1] == '?':
      break
   elif A[1] == '+':
      print(int(A[0])+int(A[2])
   elif A[1] == '-':
      print(int(A[0])-int(A[2])
   elif A[1] == '*':
      print(int(A[0])*int(A[2])
   elif A[1] == '/':
      print(int(A[0])/int(A[2])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8

while True:
   A = raw_input().split()
   if A[1] == '?':
      break
   if A[1] == '+':
      print(int(A[0])+int(A[2])
   if A[1] == '-':
      print(int(A[0])-int(A[2])
   if A[1] == '*':
      print(int(A[0])*int(A[2])
   if A[1] == '/':
      print(int(A[0])/int(A[2])

Submission status: Runtime Error

Solution code:
 sec    7404 KB     68 bytes     
?
1
2
3
4
while 1:
    s=input()
    if '?' in s:break
    print(int(eval(s)))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
#-*- coding: utf-8 -*-

import sys

if __name__ == '__main__':
    line = None
    while 1:
        line = raw_input()
        if line == '0 ? 0':
            break
        a, op, b = line.split()
        if op == '+':
            print int(a) + int(b)
        elif op == '-':
            print int(a) - int(b)
        elif op == '*':
            print int(a) * int(b)
        elif op == '/':
            print int(a) / int(b)

Submission status: Runtime Error

Solution code:
a,op,b=map(str,input().split())
while op not '?':
 if op=='+':
   print(int(a)+int(b))
 elif op=='-':
   print(int(a)-int(b))
 elif op=='*':
   printf(int(a)*int(b))
 elif op=='/':
   printf(int(a)//int(b))
 a,op,b=map(str,input().split())

Submission status: Runtime Error

Solution code:
a,op,b=map(str,input().split())
while op!='?':
 if op=='+':
   print(int(a)+int(b))
 elif op=='-':
   print(int(a)-int(b))
 elif op=='*':
   printf(int(a)*int(b))
 elif op=='/':
   printf(int(a)//int(b))
 a,op,b=map(str,input().split())

Submission status: Runtime Error

Solution code:
while True:
 a,op,b=map(str,input().split())
 if op=='+':
   print(int(a)+int(b))
 elif op=='-':
   print(int(a)-int(b))
 elif op=='*':
   printf(int(a)*int(b))
 elif op=='/':
   printf(int(a)//int(b))
 elif op=='?':
   break

Submission status: Runtime Error

Solution code:
while True:
    inp = input()
    x, y = (int(inp[0]), int(inp[2]))
    op = inp[1]
    if op == '?':
        break
    else:
        if op == '+':
            print(x + y)
        elif op == '-':
            print(x - y)
        elif op == '*':
            print(x * y)
        elif op == '/':
            print(x // y)

Submission status: Runtime Error

Solution code:
while True:
    a,op,c=input().split()
    if op=="+":
        print(int(a)+int(c))
    elif op=="-":
        print(int(a)-int(c))
    elif op=="*":
        print(int(a)*int(c))
    elif op=="/":
        print(int(a)//int(c))

Submission status: Runtime Error

Solution code:
    a,b,c=input().split()
    a=int(a)
    c=int(c)
    
    if b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(a//c)

Submission status: Runtime Error

Solution code:
import fractions
import re

mode = 'fractions'
symbols = {'$': 0, '+': 1, '-': 1, '*': 2, '/': 2, '%': 2, '^': 3}
operations = {
    '+': (lambda a, b: a + b),
    '-': (lambda a, b: a - b),
    '*': (lambda a, b: a * b),
    '/': (lambda a, b: a / b),
    '%': (lambda a, b: a % b),
    '^': (lambda a, b: a ** b)
}


def insert(string, char, target):
    return string[:target] + char + string[target:]


def add_blank(formula):
    targets = []
    for n, i, j in zip(range(1, len(formula)), formula[:-1], formula[1:]):
        if i.isnumeric() != j.isnumeric():
            targets.append(n)
    n = 0
    for i in targets:
        formula = insert(formula, ' ', i + n)
        n += 1
    return formula


def to_rpn(str_formula):
    op_stack = []
    result_list = []
    for i in str_formula.split():
        if i.isnumeric():
            result_list.append(i)
        elif not op_stack or symbols[op_stack[-1]] < symbols[i]:
            op_stack.append(i)
        else:
            while op_stack and not symbols[op_stack[-1]] < symbols[i]:
                result_list.append(op_stack.pop())
            op_stack.append(i)
    result_list.extend(op_stack[::-1])
    return ' '.join(result_list)


def calculate_rpn(rpn_formula):
    result_stack = []
    for i in rpn_formula.split():
        if i in operations.keys():
            a = result_stack.pop()
            b = result_stack.pop()
            result_stack.append(operations[i](b, a))
        elif i == '$':
            a = result_stack.pop()
            result_stack.append(a)
        else:
            result_stack.append(fractions.Fraction(i))
    result = result_stack[0]
    if result.denominator == 1:
        return int(result)
    elif mode == 'float':
        return float(result)
    elif mode == 'fractions':
        return result


def calculate(formula):
    regex = re.compile(r'\([^()]*\)')
    while regex.search(formula):
        for i in regex.finditer(formula):
            formula = formula.replace(i[0], str(calculate_rpn(to_rpn(add_blank(i[0][1:-1])))))
    return calculate_rpn(to_rpn(add_blank(formula)))


def repl():
    global mode
    while True:
        s = input()
        if not s:
            break
        elif s.split()[0] == ':mode':
            mode = s.split()[1]
        else:
            print(calculate(s))


if __name__ == '__main__':
    repl()

Submission status: Runtime Error

Solution code:
while 1:
    k=input()split()
    k[0]=int(k[0])
    k[2]=int(k[2])
    
    if k[1]=="?":
        break:
    elif k[1]=="+":
        print(k[0]+k[2])
    elif k[1]=="-":
        print(k[0]-k[2])
    elif k[1]=="*":
        print(k[0]*k[2])
    elif k[1]=="/":
        print(k[0]/k[2])

Submission status: Runtime Error

Solution code:
import math
def solve(input_text):
    for line in input_text:
        op=line[1]
        a=int(line[0])
        b=int(line[2])
        ans=0
        
        if op=='+':
            ans=a+b
        if op=='-':
            ans=a-b
        if op=='*':
            ans=a*b
        if op == '/':
            ans =math.float(a/b)
        print(ans)
    
def answer():
    input_text=[]
    line=[]
    
    while True:
        
        line = input()
        line= line.split(' ')
        if line[1]=='?':
            break
        input_text.append(line)
    
    solve(input_text)

if __name__ =='__main__':
    answer()

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    a,b,c = line.split()
    a,c = int(a), int(c)
    p = '+-*/?'.index(b)
    if p = 0:: a += c
    elif p == 1: a -= c
    elif p == 2: a *= c 
    elif p == 3: a /= c
    elif p == 4: break
    print a

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    a,b,c = line.split()
    a,c = int(a), int(c)
    p = '+-*/?'.index(b)
    if p = 0: a += c
    elif p == 1: a -= c
    elif p == 2: a *= c 
    elif p == 3: a /= c
    elif p == 4: break
    print a

Submission status: Runtime Error

Solution code:
while True:
    a, op, b = raw_input().split()
    a = int(a)
    b = int(b)

    if op == '+': a += c
    elif op == '-': a -= c
    elif op == '*': a *= c 
    elif op == '/': a /= c
    elif op == '?': break
    print a

Submission status: Runtime Error

Solution code:
while 1:
    a,op,b=raw_input().split()
    if(a==b=='0' and op=='?'): break
    a,b=map(int,[a,b])
    ans=0
    if op=='+':
        ans=a+b
    elif op=='-':
        ans=a-b
    elif op=='*':
        ans=a*b
    elif op=='/':
        ans=a/b
    print ans

Submission status: Runtime Error

Solution code:
while 0 == 0:
        i = map(str,raw_input().split())
        i[0] = int(i[0])
        i[2] = int(i[2])
        if i[1] == "+":
                print i[0]+i[2]
        elif i[1] == "-":
                print i[0]-i[2]
        elif i[1] == "*":
                print i[0]*i[2]
        elif i[1] == "/":
                print i[0]/i[2]
        elif i[1] == "?":
                pass
        else:
                print "error"

Submission status: Runtime Error

Solution code:
while true:
    a = input()
    if a[1] == "?":
        break
    if a[1] == "+":
        print a[0]+a[2]
    elif a[1] == "-":
        print a[0]-a[2]
    elif a[1] == "*":
        print a[0]*a[2]
    elif a[1] == "/":
        print a[0]/a[2]

Submission status: Runtime Error

Solution code:
while true:
    a, op, b = raw_input().split
    if op == "?":
        break
    if op == "+":
        print a+b
    elif op == "-":
        print a-b
    elif op == "*":
        print a*b
    elif op == "/":
        print a/b

Submission status: Runtime Error

Solution code:
while True:
    a, op, b = raw_input().split
    if op == "?":
        break
    if op == "+":
        print a+b
    elif op == "-":
        print a-b
    elif op == "*":
        print a*b
    elif op == "/":
        print a/b