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:
d = {
    "+": lambda a,b: a+b,
    "-": lambda a,b: a-b,
    "*": lambda a,b: a*b,
    "/": lambda a,b: a//b
}

while True:
    lst = input().split()

    if lst[1] == "?":
        break
    else:
        print(d[lst[1]](int(lst[0]), int(lst[2])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
answers=[]
while True:
    iquation=[]
    iquation=input().split()
    iquation[0]=int(iquation[0])
    iquation[2]=int(iquation[2])
    if iquation[1]=='+':
        answers.append(iquation[0]+iquation[2])
    elif iquation[1]=='-':
        answers.append(iquation[0]-iquation[2])
    elif iquation[1]=='*':
        answers.append(iquation[0]*iquation[2])
    elif iquation[1]=='/':
        answers.append(int(iquation[0]/iquation[2]))
    elif iquation[1]=='?':
        break
    else:
        print('error')
for i in range(0,len(answers)):
    print(answers[i])

Submission status: Accepted

Solution code:
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:
while True:
    data = list(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)
    else:
        print(a//b)

Submission status: Accepted

Solution code:

my_value_list = []

while True:
    try:
        my_value_list.append(input().split())
    except EOFError:
        break

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

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    a, op, b = line.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:
x, op, y = input().split()
x = int(x)
y = int(y)
while op != "?" :
 if op == "+" :
  print(x + y)
 elif op == "-":
  print(x - y)
 elif op == "*":
  print(x * y)
 elif op == "/":
  print(x // y)
 x, op, y = input().split()
 x = int(x)
 y = int(y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# (c) midandfeed
while(True):
	a, op, b = [x for x in input().split()]
	
	if (op == '?'):
		break
	if (op == '/'):
		op = '//'
	
	print(eval("{} {} {}".format(a, op, b)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:

    l = [str(i) for i in input().split()]

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

    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:
    line = input().split()
    if line[1] == '+':
        print(int(line[0]) + int(line[2]))
    if line[1] == '-':
        print(int(line[0]) - int(line[2]))
    if line[1] == '*':
            print(int(line[0]) * int(line[2]))
    if line[1] == '/':
        print(int(line[0]) // int(line[2]))
    if line[1] == '?':
        break

Submission status: Accepted

Solution code:
while True:
    x = raw_input().split()

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

    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

inputs = sys.stdin
for line in inputs:
    a, op, b = line.strip().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:
result = []

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

    if op == "+":
        result.append(a + b)
    elif op == "-":
        result.append(a - b)
    elif op == "*":
        result.append(a * b)
    elif op == "/":
        result.append(a // b)
    elif op == "?":
        break
    else:
        pass

for i in range(len(result)):
    print("{0:.0f}".format(result[i]))

Submission status: Accepted

Solution code:
import sys
import math
while True:
    x = sys.stdin.readline().strip()
    a = list(x.split())
    if a[1] == "?":
        break
    else:
        x = int(a[0])
        y = int(a[2])
        if a[1] == "+":
            print(x + y)
        elif a[1] == "-":
            print(x - y)
        elif a[1] == "*":
            print(x * y)
        elif a[1] == "/":
            print(math.floor(x / y))

Submission status: Accepted

Solution code:
while True:
    inst = input()
    if inst.find("?") > 0:
        break
    print(eval(inst.replace("/", "//")))

Submission status: Accepted

Solution code:
x = []

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

Submission status: Accepted

Solution code:
import sys

output = []

def main():
    lines = sys.stdin.readlines()

    for line in lines:
        # print(line)
        line = line.strip('\n')
        elems = line.split(" ")
        output_num = 0
        if elems[1] == '+':
            output_num = int(elems[0]) + int(elems[2])
        elif elems[1] == '-':
            output_num = int(elems[0]) - int(elems[2])
        elif elems[1] == '*':
            output_num = int(elems[0]) * int(elems[2])
        elif elems[1] == '/':
            output_num = int(elems[0]) / int(elems[2])
        elif elems[1] == '?':
            sys.exit()
        print(output_num)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
 ins=input().split()
 a = int(ins[0])
 b = int(ins[2])
 op = ins[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 True :
    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)
    elif (b == "?"):
        break

Submission status: Accepted

Solution code:
import sys
def main():
    for line in sys.stdin:
        F = line.split() #formula
        if F[1] == "?":
            break
        else:
            a = int(F[0])
            b = int(F[2])
            op = F[1]
            ans = 0
            if op == "+":
                ans = a + b
            elif op == "-":
                ans = a - b
            elif op == "/":
                ans = a // b
            elif op == "*":
                ans = a * b
            print(ans)
            

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
while True:
	data = raw_input().split(" ")
	a = int(data[0])
	op = data[1]
	b = int(data[2])

	if op == "?":
		break
	elif op == "+":
		ans = a + b
	elif op == "-":
		ans = a - b
	elif op == "*":
		ans = a * b
	else:
		ans = a / b

	print ans

Submission status: Accepted

Solution code:

flag =0
while flag==0:
    a,b,c=[ i for i in input().split()]
    if b=="?":
        flag=1
        break
    elif b=="+":
        n=int(a)+int(c)
    elif b=="-":
        n=int(a)-int(c)
    elif b=="*":
        n=int(a)*int(c)
    elif b=="/":
        n=int(a)/int(c)
    print(int(n))

Submission status: Accepted

Solution code:
flag =0
while flag==0:
    a,b,c=[ i for i in input().split()]
    if b=="?":
        flag=1
        break
    elif b=="+":
        n=int(a)+int(c)
    elif b=="-":
        n=int(a)-int(c)
    elif b=="*":
        n=int(a)*int(c)
    elif b=="/":
        n=int(a)/int(c)
    print(int(n))

Submission status: Accepted

Solution code:
while True:
    a, op, b = input().split()
    a,b = int(a), int(b)
    op_dict = {'+': (lambda x,y: x + y),
               '-': (lambda x,y: x - y),
               '*': (lambda x,y: x * y),
               '/': (lambda x,y: x // y),
               '?': '?'}
    func = op_dict[op]
    if func == '?': break 
    print('%d' % int(func(a, b)))

Submission status: Accepted

Solution code:
while True:
    line = input()

    if line == '?':
        break

    a, op, b = line.split()
    a = int(a)
    b = int(b)

    if op == '?':
        break
    elif op == '+':
        ans = a + b
    elif op == '-':
        ans = a - b
    elif op == '*':
        ans = a * b
    elif op == '/':
        ans = int(a / b)
    else:
        break

    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_4_C&lang=jp

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    while True:
        ans = 0
        a, op, b = input().split()
        a = int(a)
        b = int(b)
        if op == '?':
            break
        elif op == '+':
            ans = a + b
        elif op == '-':
            ans = a - b
        elif op == '*':
            ans = a * b
        elif op == '/':
            ans = a // b

        print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
while True:
  try:
    print(int(eval(input())))
  except SyntaxError:
    break

Submission status: Accepted

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

Submission status: Accepted

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

#import fileinput
import math

def main():
    while True:
        a, b, c = input().split()

        if (b == '?'):
            break
        else:
            if (b == '+'):
                print('%d' % (int(a)+int(c)))
            elif (b == '-'):
                print('%d' % (int(a)-int(c)))
            elif (b == '*'):
                print('%d' % (int(a)*int(c)))
            elif (b == '/'):
                print('%d' % (int(a)/int(c)))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
while True:
    nums = input().split()
    a = int(nums[0])
    b = int(nums[2])
    op = nums[1]
    
    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: Accepted

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

Submission status: Accepted

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.pop()
for st in a:
    print("{0}".format(calc(st)))

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:
def main():
    while True:
        a, op, b = input().split()
        #a, b = int(a), int(b)
        if op == "?":
            break
        elif op == "/":
            op = "//"
        print(eval(a + op + b))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
while True:
    l = input()
    if ("?" in l):
        break

    print(eval(l.replace("/","//")))

Submission status: Accepted

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

Submission status: Accepted

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:
  b=eval(''.join(t))
  print(b)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
while True:
 a=input()
 if a.find('?')>0:break
 print(int(eval(''.join(a.split()))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    a,op,b = map(str,input().split())
    a = int(a)
    b = int(b)
    
    if 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: Accepted

Solution code:
import math

class Calc:
    def __init__(self,a,op,b):
        self.a = a
        self.b = b
        self.op = op

    def calc(self):
        if self.op == "+":
            return self.a + self.b
        elif self.op == "-":
            return self.a - self.b
        elif self.op == "*":
            return self.a * self.b
        elif self.op == "/":
            try:
                ans = self.a / self.b
            except ZeroDivisionError:
                return 0
            else:
                return ans
        else:
            return "Invalid Operator."

def main():
    data = []
    while 1:
        n = input().split()
        a = int(n[0])
        op = n[1]
        b = int(n[2])
        if op == "?":
            break

        data.append(Calc(a,op,b))

    for i in data:
        print(int(i.calc()))

if __name__ == "__main__":
    main()

Submission status: Accepted

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))
    x,b,z = input().split()
    a=int(x)
    c=int(z)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# 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 == '?':
        break
    print "%d" % answer

Submission status: Accepted

Solution code:
while True:
	l = raw_input().split()
	a = int(l[0])
	op = l[1]
	b = int(l[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:
while True:
    s = input()
    if '?' in s:
        break
    print(int(eval(s)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    instr = input()
    instrSp = instr.split()
    x = int(instrSp[0])
    op = str(instrSp[1])
    y = int(instrSp[2])

    res = 0
    if op == '+':
        res = x + y
    elif op == '-':
        res = x - y
    elif op == '*':
        res = x * y
    elif op == '/':
        res = x // y
    else:
        break
    print(res)

Submission status: Accepted

Solution code:
from operator import *
while True:
    a, op, b = input().split()
    if op == "?":
        break
    print({"+":add, "-":sub, "/":floordiv, "*":mul}[op](int(a), int(b)))

Submission status: Accepted

Solution code:
while True:
	try:
		line = input()
		if  '?' in line:
			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: Accepted

Solution code:
while True:
    a,op,b = [x for x in input().split( )]
    a,b = [int(y) for y in [a,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 = raw_input()
    x = x.split(" ")
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    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()
    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:
    x=input().split()
    a=int(x[0])
    op=x[1]
    b=int(x[2])

    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:
    SC = input()
    SClist = SC.split()
    a = int(SClist[0])
    b = int(SClist[2])

    if SClist[1] == '+':
        print(a+b)
    elif SClist[1] == '-':
        print(a-b)
    elif SClist[1] == '*':
        print(a*b)
    elif SClist[1] == '/':
        print(a//b)
    elif SClist[1] == '?':
        break

Submission status: Accepted

Solution code:
def scalc():
    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(int(a/b))
        else :
            break
    return 0

if __name__ == "__main__":
    ret = scalc()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Computation - Simple Calculator

while True:
    a,op,b=map(str,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))
    elif op=="/":
        print((int(a)//int(b)))

Submission status: Accepted

Solution code:
from sys import stdin
for line in stdin:
	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)
	else:
		break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
while(True) :
    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))
    elif op=='/' :
        print("{}".format(int(a/b)))
    else :
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8

while True:
    a, op, b =  (i for i in 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(int(a / b))

    else:
        break

Submission status: Accepted

Solution code:

for i in range(10000):
    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(int(a)/int(b)))

Submission status: Accepted

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

import sys

while True:
    a, op, b = sys.stdin.readline().split()
    ai = int(a)
    bi = int(b)
    if op == '?':
        break
    elif op == '+':
        print(ai + bi)
    elif op == '-':
        print(ai - bi)
    elif op == '*':
        print(ai * bi)
    elif op == '/':
        print(ai // bi)
    else:
        raise ValueError

Submission status: Accepted

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

Submission status: Accepted

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

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:
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:
while True:
    a, op, b = input().rstrip().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))
    elif op == "/":
        print(int(a) // int(b))

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:
#!/usr/bin/env python

if __name__ == '__main__':
    while True:
        a, op, b = raw_input().split()
        if op == '?':
            break

        a, b = map(int, [a, b])
        print a+b if op=='+' else a-b if op=='-' else a*b if op=='*' else a/b

Submission status: Accepted

Solution code:
import math
x=[]
i=0
while 1:
    l=input().split()
    a=int(l[0])
    b=int(l[2])
    op=str(l[1])

    if op=="?":
        break
    elif op=="/":
        if b==0:
            pass
        else:
            x.append(math.floor(eval(str(a)+op+str(b))))
            i=i+1
    else:
        x.append(eval(str(a)+op+str(b)))
        i=i+1

m=0
while m<i:
    print(x[m])
    m=m+1

Submission status: Accepted

Solution code:
ans = ''
while True:
    a, op, b = map(str, input().split(' '))
    if op == '?':
        break
    else:
        a = int(a)
        b = int(b)
        if op == '+':
            ans += str(int(a + b)) + '\n'
        elif op == '-':
            ans += str(int(a - b)) + '\n'
        elif op == '*':
            ans += str(int(a * b)) + '\n'
        else:
            ans += str(int(a // b)) + '\n'
if ans != '':
    print(ans[:-1])

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:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
r = []

while True:
    n = input().split()
    a = n[0]
    op = n[1]
    b = n[2]
    a = int(a)
    b = int(b)
    op = str(op)
    if op == "+":
        a1 = a + b
        r.append(a1)
    elif op == "-":
        a2 = a - b
        r.append(a2)
    elif op == "*":
        a3 = a * b
        r.append(a3)
    elif op == "/":
        a4 = a // b
        r.append(a4)
    elif op == "?":
        break

for item in r:
    print(item)