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: Accepted

Solution code:
#coding: UTF-8
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
while True:
    data = raw_input().split();
    #print data[0] , data[1], data[2]
    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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
#coding:utf-8
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
import sys

l = sys.stdin.readlines()

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your 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)
    else:
        break

Submission status: Accepted

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

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

    # 0?????´??? ????????????
    if op == "?":
        # exec end
        break
    elif op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)

Submission status: Accepted

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

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

    # 0?????´??? ????????????
    if op == '?':
        # exec end
        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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]))

Submission status: Accepted

Solution code:
#coding:utf-8

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))

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
#!usr/bin/env python3

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()

Submission status: Accepted

Solution code:
#!usr/bin/env python3

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}

    # TODO Refactor the ugly code below into the function above.
    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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3

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}

    # TODO Refactor: include the ugly code below into the function above.
    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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ITP1_4_C:   Simple Calculator
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
result = []
while True:
    a,op,b = input().split()
    
    if op == '?':
        break
    elif op == '+':
        result.append(int(a) + int(b))
    elif op == '-':
        result.append(int(a) - int(b))
    elif op == '*':
        result.append(int(a) * int(b))
    elif op == '/':
        result.append(int(int(a) / int(b)))
        
for i in result:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
while True:
    a, op, b= input().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)

Submission status: Accepted

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

import sys
import os
import math


for s in sys.stdin:
    lis = s.split()

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

    if op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(math.floor(a / b))
    else:
        break

Submission status: Accepted

Solution code:
# cording: utf-8

num = []

while True:
    list = input().rstrip().split(" ")
    if str(list[1]) == "?":
        break
    num.append(list)

for i in range(len(num)):
    if str(num[i][1]) == "+":
        print(int(num[i][0]) + int(num[i][2]))
    elif str(num[i][1]) == "-":
        print(int(num[i][0]) - int(num[i][2]))
    elif str(num[i][1]) == "*":
        print(int(num[i][0]) * int(num[i][2]))
    else:
        print(int(num[i][0]) // int(num[i][2]))

Submission status: Accepted

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 == '*':
        print(int(a) * int(b))
    elif op == '/':
        print(int(a) // int(b))
    elif op == '?':
        break

Submission status: Accepted

Solution code:
while 1:
    a,op,b = map(str,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))
    else:
        print(int(a) // int(b))

Submission status: Accepted

Solution code:
while True:
    l = input().split()

    if l[1] == '?':
        break
    print(int(eval(l[0]+l[1]+l[2])))