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

Solution (Python):
import sys

s = sys.stdin.readlines()
for i in s:
    a, op, b = i.split()
    a, b = int(a), int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)

Solution (Python):
import sys

s = sys.stdin.readlines()
for i in s:
    if '?' in i:
        break
    print(eval(i.replace('/', '//')))

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

Solution (Python):
while True:
    a = input()
    if '?' in a:
        break
    print("{0}".format(eval(a.replace('/', '//'))))

Solution (Python):
AOPB = input().split()
a = int(AOPB[0])
b = int(AOPB[2])
op = AOPB[1]
while op != "?":
    if op == "+":
        print(a+b)
    elif op == "-":
        print(a-b)
    elif op == "*":
        print(a*b)
    elif op == "/":
        print(a//b)
    AOPB = input().split()
    a = int(AOPB[0])
    b = int(AOPB[2])
    op = AOPB[1]

Solution (Python):



while 1:
    aopb = raw_input().split()
    if aopb[1] == "+":
        print int(aopb[0]) + int(aopb[2])
    elif aopb[1] == "-":
        print int(aopb[0]) - int(aopb[2])
    elif aopb[1] == "*":
        print int(aopb[0]) * int(aopb[2])
    elif aopb[1] == "/":
        print int(aopb[0]) / int(aopb[2])
    else:
        break

Solution (Python):
while True:

	a, op, b = map(str, raw_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 == '/':
		if b != 0:
			print a / b
	elif op == '?':
		break
	else:
		break

Solution (Python):
import sys

while True:
    data = sys.stdin.readline().strip().split(' ')
    a = int(data[0])
    b = int(data[2])
    op = data[1]
    if op == '?':
        break

    if op == '+':
        ans = a + b
    elif op == '-':
        ans = a -b
    elif op == '*':
        ans = a * b
    else:
        ans = a // b

    print(ans)

Solution (Python):
while 1:

    x,op,y = raw_input().split()

    if op == "?":
        break

    x = int(x)
    y = int(y)

    if op == "+":
        print x+y
    elif op == "-":
        print x-y
    elif op == "*":
        print x*y
    else:
        print x/y

Solution (Python):
while True:
    a = input()
    try:
        i = a.index('?')
    except:
        print(int(eval(a)))
    else:
        break

Solution (Python):
a = []
while True:
    x, op, y = input().split()
    if op == '?':
        break
    x = int(x); y = int(y)
    if op == '+':
        a.append('{}'.format(x+y))
    elif op == '-':
        a.append(x-y)
    elif op == '*':
        a.append(x*y)
    else:
        a.append(x//y)
for x in a:
    print('{}'.format(x))

Solution (Python):
a = []
while True:
    m,n,o = input().split()
    m=int(m)
    o=int(o)
    if n == "?":
        break
    if n=="+":
    	a.append(m+o)
    elif n=="-":
    	a.append(m-o)
    elif n=="*":
    	a.append(m*o)
    elif n=="/":
    	a.append(int(m/o))
 

for i in a:
	print(i)

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

Solution (Python):

import math

def SC(F):
    for i in range(len(F)):
        ele = F[i].split(" ")
        if ele[1] == "+":
            print(int(ele[0]) + int(ele[2]))
        elif ele[1] == "-":
            print(int(ele[0]) - int(ele[2]))
        elif ele[1] == "*":
            print(int(ele[0]) * int(ele[2]))
        elif ele[1] == "/":
            print(int(int(ele[0]) / int(ele[2])))
        else:
            break
if __name__=="__main__":
    F = []
    for i in range(100000000):
        F.append(input())
        if F[i].split(" ")[1] == "?":
            break
    SC(F)

Solution (Python):
while 1:
    a, op, b = input().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(int(a) / int(b)))
    elif op == "?":
        break

Solution (Python):
while True:
    data = raw_input().split();
    
    a = int(data[0])
    b = int(data[2])
    
    if data[1] == '?' :
        break
    elif data[1] == '+':
        print a + b
    elif data[1] == '-':
       print a - b
    elif data[1] == '*':
       print a * b
    elif data[1] == '/':
       print a / b

Solution (Python):
while True:
    data = input()
    if "?" in data:
        break
    print(eval(data.replace("/","//")))

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

Solution (Python):
while 1:
  a, op, b = input().split()
  if op == '?':
    break
  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)

Solution (Python):
while True:
    ins = input().split()
    
    a = int(ins[0])
    b = int(ins[2])
    op = ins[1]

    if op == "?":
        break
    elif op == "+":
        print(a+b)
    elif op == "-":
        print(a-b)
    elif op == "/":
        print(a//b)
    else:
        print(a*b)

Solution (Python):
n=0
l= []
while True:
	X,op,Y= input().split()
	x= int(X)
	y= int(Y)
	if(op== '?'):
		break
	elif(op== '+'):
		l.append(x+y)
	elif(op== '*'):
		l.append(x*y)
	elif(op== '-'):
		l.append(x-y)
	elif(op== '/'):
		l.append(x//y)
	n+=1
for i in range(n):
	print(l[i])

Solution (Python):
while True:
    x = raw_input().split()
    a,op,b = int(x[0]),x[1],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

Solution (Python):
import math
while True:
    ins = input().split()
    x = int(ins[0])
    op = ins[1]
    y = int(ins[2])
    if op == "+":
        print(x + y)
    elif op == "-":
        print(x - y)
    elif op == "/":
        print(math.floor(x / y))
    elif op == "*":
        print(x * y)
    elif op == "?":
        break
    else:
        break

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

Solution (Python):
while True:
    x = input().split()
    if x[1] == '+':
        y = int(x[0])+int(x[2])
        print(y)
    elif x[1] == '-':
        y = int(x[0])-int(x[2])
        print(y)
    elif x[1] == '*':
        y = int(x[0])*int(x[2])
        print(y)
    elif x[1] == '/':
        y = int(x[0])//int(x[2])
        print(y)
    elif x[1] == '?':
        break

Solution (Python):
while True:
    a,op,b = input().split()
    
    if op == "?":
        break
    elif 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))

Solution (Python):
while True:
    line = input().split()
    if line[1]=='?': break
    a, b, op = int(line[0]),int(line[2]),line[1]
    if op=='+': result = a+b
    elif op=='-': result = a-b
    elif op=='*': result = a*b
    elif op=='/': result = a//b
    print(result)

Solution (Python):
while(True):
    a, op, b = input().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))
    elif(op == '?'):
        break

Solution (Python):

a,op,b=map(str,input().split())
a,b=int(a),int(b)

while op!="?":
    if op=="+":
        ans=a+b
    elif op=="-":
        ans=a-b
    elif op=="*":
        ans=a*b
    elif op=="/":
        ans=a//b

    print(ans)

    a,op,b=map(str,input().split())
    a,b=int(a),int(b)

Solution (Python):
while True:
    data = input()
    if '?' in data:
        break
    print(eval(data.replace('/','//')))

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

Solution (Python):
while True:
    s = raw_input()
    if s.split()[1] == '?':
        break
    print eval(s)

Solution (Python):
import sys

for line in sys.stdin:
    [a, op, b] = line.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)
    else:
        break

Solution (Python):
ans = 0
while True:
    x = input()
    x = x.split(" ")
    if x[1] == "?": break
    if x[1] == "+":
        ans = int(x[0]) + int(x[2])
    elif x[1] == "-":
        ans = int(x[0]) - int(x[2])
    elif x[1] == "*":
        ans = int(x[0]) * int(x[2])
    elif x[1] == "/":
        ans = int(x[0]) / int(x[2])
    print("%d" % ans)

Solution (Python):
while True:
    v = raw_input()
    a = v.split(' ')
    if a[1] == "?":
        break
    if 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])

Solution (Python):
import sys

for i in sys.stdin:
    a,op,b = i.replace('/','//').split()
    if op == "?":
        break
    else:
        print(eval(a+op+b))

Solution (Python):
import sys

l = sys.stdin.readlines()

for i in l:
    if "?" in i:
        break
    else:
        str = i.replace('/','//')
        print(eval(str))

Solution (Python):
import sys

l = sys.stdin.readlines()

for i in l:
    if "?" in i:
        break
    else:
        str = i.replace('/','//')
        print(eval(str))

Solution (Python):
import sys

for i in sys.stdin:
    if "?" in i:
        break
    else:
        print(eval(i.replace("/","//")))

Solution (Python):
while True:
    try:
        buf = input()
        print(int(eval(buf)))
    except:
        a, op, b = buf.split(' ')
        if op == '?':
            exit()

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

Solution (Python):
matrix = []
while True:
    values = input()
    if '?' in values:
        break
    matrix.append([x for x in values.split()])
    
for a, op, b in matrix:
    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))
    else:
        pass

Solution (Python):
if __name__ == '__main__':

    while True:
        key_in = input()
        data = key_in.split(' ')

        a = int(data[0])
        op = data[1]
        b = int(data[2])

        if op == '+':
            print('{0}'.format(a + b))
        if op == '-':
            print('{0}'.format(a - b))
        if op == '*':
            print('{0}'.format(a * b))
        if op == '/':
            print('{0}'.format(a // b))
        if op == '?':
            break

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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

Solution (Python):
while True:
    a, op, b = input().split()
    if op == "?":
        break
    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(a)//int(b))

Solution (Python):
while 1:
    data = input()
    if '?' in data:
        break
    print(eval(data.replace('/','//')))

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

Solution (Python):
a=[]
b=[]
op=[]
while True:
    x,y,z=raw_input().split()
    if(y=='?'):
        break
    a.append(int(x))
    op.append(y)
    b.append(int(z))
A=iter(a)
B=iter(b)
OP=iter(op)
for n in A:
    p=B.next()
    q=OP.next()

    if(q=='+'):
        print(n+p)
    elif(q=='*'):
        print(n*p)
    elif(q=='-'):
        print(n-p)
    elif(q=='/'):
        print(n/p)

Solution (Python):
while True:
    try:
        print(int(eval(input())))
    except Exception as e:
        break

Solution (Python):
s=input().split()
a=int(s[0])
b=int(s[2])
c=s[1]
while (c!='?'):
    if(c=='+'):print(a+b)
    elif(c=='-'):print(a-b)
    elif(c=='*'):print(a*b)    
    elif(c=='/'):print(int(a/b))
    s=input().split()
    a=int(s[0])
    b=int(s[2])
    c=s[1]

Solution (Python):


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)
    else:
        break

Solution (Python):
'''
ITP-1_4-C
 ?¨???????
???????????´??° a, b ??¨?????????????????? op ?????????????????§???a op b ????¨??????????????????°?????????????????????????????????
????????????????????? op ??????"+"(???)???"-"(???)???"*"(???)???"/"(???)???????????¨?????????????????§????????????????????´?????????
?°???°?????\??????????????¨????????????????¨????????????¨????????????
???Input
??\???????????°????????????????????????????§???????????????????????????????????????????????????¢????????\????????¨????????§??????
 a op b
op ??? '?' ?????¨??? ??\?????????????????????????????????????????±???????????????????????£????????????????????????
???Output
?????????????????????????????????????¨??????????????????????????????????????????????
'''

import sys


for inputData in sys.stdin:
    inputList = inputData.split()
    a, op, b = int(inputList[0]), inputList[1], int(inputList[2])
    retVal = 0

    
    if op == "?":
        
        break
    elif op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)

Solution (Python):
'''
ITP-1_4-C
 ?¨???????
???????????´??° a, b ??¨?????????????????? op ?????????????????§???a op b ????¨??????????????????°?????????????????????????????????
????????????????????? op ??????"+"(???)???"-"(???)???"*"(???)???"/"(???)???????????¨?????????????????§????????????????????´?????????
?°???°?????\??????????????¨????????????????¨????????????¨????????????
???Input
??\???????????°????????????????????????????§???????????????????????????????????????????????????¢????????\????????¨????????§??????
 a op b
op ??? '?' ?????¨??? ??\?????????????????????????????????????????±???????????????????????£????????????????????????
???Output
?????????????????????????????????????¨??????????????????????????????????????????????
'''

import sys


for inputData in sys.stdin:
    inputList = inputData.split()
    a, op, b = int(inputList[0]), inputList[1], int(inputList[2])
    retVal = 0

    
    if op == '?':
        
        break
    elif op == '+':
        retVal = a + b
    elif op == '-':
        retVal = a - b
    elif op == '*':
        retVal = a * b
    elif op == '/':
        retVal = a // b
    else:
        retVal = 0

    
    print(retVal)

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

Solution (Python):
dataset = []
op = ""
while op is not "?":
    a, op, b = map(str, input().split())
    a = int(a)
    b = int(b)
    if (a >= 0 and a <= 20000) and (b >= 0 and b <= 20000):
        listed = []
        listed.append(a)
        listed.append(op)
        listed.append(b)
        dataset.append(listed)
    elif op is "?":
        break
    else:
        break

for i in dataset:
    if i[1] is "+":
        print("{0}".format(i[0] + i[2]))
    elif i[1] is "-":
        print("{0}".format(i[0] - i[2]))
    elif i[1] is "*":
        print("{0}".format(i[0] * i[2]))
    elif i[1] is "/":
        print("{0}".format(int(i[0] / i[2])))
    else:
        pass

Solution (Python):
while True:
    a,op,b = raw_input().split()
    if '?' == op:
        exit()
    a = int(a)
    b = int(b)
    if '+' == op:
        print a + b
    if '-' == op:
        print a - b
    if '*' == op:
        print a * b
    if '/' == op:
        print a / b

Solution (Python):
while True:
    v = input().split()
   
    if v[1] == "?": break
    if v[1] == "+":
        print(int(v[0]) + int(v[2]))
    if v[1] == "-":
        print(int(v[0]) - int(v[2]))
    if v[1] == "*":
        print(int(v[0]) * int(v[2]))
    if v[1] == "/":
        print(int(v[0]) // int(v[2]))

Solution (Python):
dataset = []
op = ""
while op is not "?":
    a, op, b = map(str, input().split())
    a = int(a)
    b = int(b)
    if (a >= 0 and a <= 20000) and (b >= 0 and b <= 20000):
        listed = []
        listed.append(a)
        listed.append(op)
        listed.append(b)
        dataset.append(listed)
    elif op is "?":
        break
    else:
        break

for i in dataset:
    if i[1] is "+":
        print("{0}".format(i[0] + i[2]))
    elif i[1] is "-":
        print("{0}".format(i[0] - i[2]))
    elif i[1] is "*":
        print("{0}".format(i[0] * i[2]))
    elif i[1] is "/":
        print("{0}".format(int(i[0] / i[2])))
    else:
        pass

Solution (Python):
while True:
    t = input()
    if t.find("?") > 0:
        break
    print(int(eval(t)))

Solution (Python):
import math
while True :
    alist = [ x for x in input().split() ]
    if alist[1] == "?" :
        break
    elif alist[1] == "*" :
        print(int(alist[0]) * int(alist[2]))
    elif alist[1] == "/" :
        print(math.floor(int(alist[0]) / int(alist[2])))
    elif alist[1] == "+" :
        print(int(alist[0]) + int(alist[2]))
    elif alist[1] == "-" :
        print(int(alist[0]) - int(alist[2]))

Solution (Python):


def cal(a, b, op):
	if op=="+":
		return a + b
	elif op == "-":
		return a - b
	elif op == "*":
		return a * b
	elif op == "/":
		return a//b
	else:
		return -1

while True:
	buff = input().split()
	a = int(buff[0])
	b = int(buff[2])
	op = buff[1]
	if op == "?":
		break
	print(cal(a, b, op))

Solution (Python):

import sys
array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    data = array[i].split()
    a = int(data[0])
    op = str(data[1])
    b = int(data[2])
    if op == '?':
        break
    if op == '+':
        print(a+b)
    if op == '-':
        print(a-b)
    if op == '/':
        print(int(a/b))
    if op == '*':
        print(a*b)

Solution (Python):
while 1:
    a, op, b = raw_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

Solution (Python):
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

Solution (Python):
import sys
  
for line in sys.stdin:
  a,op,b=line.split()
  if op == '?':
    break
  print eval(line)

Solution (Python):
while True:
    a, op, b = input().split()
    a, b = int(a), 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

Solution (Python):
while 1:
    data = input()
    if "?" in data:
        break
    print(eval(data.replace("/","//")))

Solution (Python):
def calc(a, op, b):
    if op == "+":
        return a + b
    elif op == "-":
        return a - b
    elif op == "*":
        return a * b
    else:
        return a // b

while True:
    str_list = input().split()
    a = int(str_list[0])
    op = str_list[1] 
    b = int(str_list[2])

    if op == "?":
        break

    print(calc(a, op, b))

Solution (Python):
while 1:
	l=map(str,raw_input().split())
	answer = 0 
	if  l[1] == '+':
		answer = int (l[0]) + int (l[2])
	if  l[1] == '-':
		answer = int (l[0]) - int (l[2])
	if  l[1] == '*':
		answer = int (l[0]) * int (l[2])
	if  l[1] == '/':
		answer = int (l[0]) / int (l[2])
	if  l[1] == '?':
		break;
	print answer

Solution (Python):


import sys
import operator
from math import floor


def string_to_list_spliter():
    lst = [int(i) if isinstance(i, int) == True else i for i in sys.stdin.readline().split()]
    return lst


def main():
    ops = {'+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv}

    while True:
        lst = string_to_list_spliter()
        if lst[1] == '?':
            break
        elif lst[1] == '+':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '-':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '*':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '/':
            print(floor(ops[lst[1]](int(lst[0]), int(lst[2]))))


if __name__ == '__main__':
    main()

Solution (Python):


import sys
import operator
from math import floor


def string_to_list_spliter():
    lst = [i for i in sys.stdin.readline().split()]
    return lst


def main():
    ops = {'+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv}

    
    while True:
        lst = string_to_list_spliter()
        if lst[1] == '?':
            break
        elif lst[1] == '+':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '-':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '*':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '/':
            print(floor(ops[lst[1]](int(lst[0]), int(lst[2]))))


if __name__ == '__main__':
    main()

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

Solution (Python):


import sys
import operator
from math import floor


def string_to_list_spliter():
    lst = [i for i in sys.stdin.readline().split()]
    return lst


def main():
    ops = {'+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv}

    
    while True:
        lst = string_to_list_spliter()
        if lst[1] == '?':
            break
        elif lst[1] == '+':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '-':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '*':
            print(ops[lst[1]](int(lst[0]), int(lst[2])))
        elif lst[1] == '/':
            print(floor(ops[lst[1]](int(lst[0]), int(lst[2]))))


if __name__ == '__main__':
    main()

Solution (Python):
def calc(a, b, op):
    """
    a: int
    b: int
    op: operator
    returns the result of arithmetic operation

    >>> calc(1, 2, '+')
    3
    >>> calc(56, 18, '-')
    38
    >>> calc(13, 2, '*')
    26
    >>> calc(100, 10, '/')
    10
    >>> calc(27, 81, '+')
    108
    """
    def add(a, b):
        return a + b
    def sub(a, b):
        return a - b
    def prod(a, b):
        return a * b
    def div(a, b):
        return a // b

    operators = {
        '+': add,
        '-': sub,
        '*': prod,
        '/': div,
    }

    if op in operators:
        return operators[op](a, b)

    raise Exception('invalid operator')


if __name__ == '__main__':

    while True:
        cmd = input().split(' ')
        (a, op, b) = (int(cmd[0]), cmd[1], int(cmd[2]))
        if op == '?':
            break
        print(calc(a, b, op))

Solution (Python):
while 1:
    a,b,c = list(map(str,input().split()))
    num_a=int(a)
    num_c=int(c)
    if b=="+":
        print(num_a+num_c)
    elif b=="-":
        print(num_a-num_c)
    elif b=="*":
        print(num_a*num_c)
    elif b=="/":
        print(num_a//num_c)
    elif b=="?":
        break

Solution (Python):
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)
    else:
        break

Solution (Python):

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

Solution (Python):
while 1:
    x,y,z=raw_input().split()
    x=int(x)
    z=int(z)
    if(y=='?'):
        break
    if(y=='+'):
        print x+z
    if(y=='-'):
        print x-z
    if(y=='/'):
        print x/z
    if(y=='%'):
        print x%z
    if(y=='*'):
        print x*z

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

Solution (Python):
while(1):
    line = input()
    words = line.split()
    a = int(words[0])
    op = words[1]
    b = int(words[2])
    if op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)
    elif op == '?':
        break

Solution (Python):
while True:
    a, op, b = input().split(" ")
    a=int(a)
    b=int(b)

    if op =="?": break
    if op =="+": print("{}".format(a + b))
    if op =="-": print("{}".format(a - b))
    if op =="*": print("{}".format(a * b))
    if op =="/": print("{}".format(a // b))

Solution (Python):
if __name__ == "__main__":
    while True:
        a,op,b = map(str,input().split())
        if op is "+":
            print("%d"%(int(a)+int(b)))
        elif op is "-":
            print("%d"%(int(a)-int(b)))
        elif op is "*":
            print("%d"%(int(a)*int(b)))
        elif op is "/":
            print("%d"%(int(a)/int(b)))
        else:
            break

Solution (Python):
while True:
	s = raw_input().rstrip().split(" ")
	a = int(s[0])
	b = int(s[2])
	if s[1]=="?":break
	if s[1]=="+":print a+b
	if s[1]=="-":print a-b
	if s[1]=="*":print a*b
	if s[1]=="/":print a//b

Solution (Python):
while True:
    a=input()
    b=a.replace("/","//")
    if "?" in b:
        break
    else:
        print(eval(b))

Solution (Python):

while(1):
	
	a, op, b = map(str, input().split())
	if op == "+":
		print("%d" % (int(a)+int(b)))
	elif op == "-":
		print("%d" % (int(a)-int(b)))
	elif op == "/":
		print("%d" % (int(a)//int(b)))
	elif op == "*":
		print("%d" % (int(a)*int(b)))
	else:
		break

Solution (Python):
while True:
    a, op, b = input().split()
    if op == "?":
        break
    if op == "/":
        op = "//"
    print(eval(a + op + b))

Solution (Python):

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

Solution (Python):
import sys
for x in sys.stdin:
    a, op, b = x.split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)

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

Solution (Python):
count = -1
a = []
while True:
    count += 1
    n = input()
    a.append(n.split())
    boy = a[count][0]
    fuck = a[count][1]
    girl = a[count][2]
    if fuck == "+":
        print(int(boy)+int(girl))
    elif fuck == "-":
        print(int(boy)-int(girl))
    elif fuck == "*":
        print(int(boy)*int(girl))
    elif fuck == "/":
        print(int(int(boy)/int(girl)))
    if a[count][1] == "?":
        break

Solution (Python):
while True:
    inps = input().split()
    if len(inps) < 3:
        print("Illegal input.")
        break
    else:
        a = int(inps[0])
        b = int(inps[2])
        if inps[1] == "+":
            print(a + b)
        elif inps[1] == "-":
            print(a - b)
        elif inps[1] == "*":
            print(a * b)
        elif inps[1] == "/":
            print(a // b)
        elif inps[1] == "?":
            break
        else:
            print("Illegal input.")
            break

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