Go: package main

import (
	"bufio"
	"fmt"
	"go/token"
	"go/types"
	"os"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	n, _ := strconv.Atoi(stdin.Text())
	for i := 0; i < n; i++ {
		stdin.Scan()
		exp := strings.TrimRight(stdin.Text(), "=")
		res, _ := types.Eval(token.NewFileSet(), nil, token.NoPos, exp)
		fmt.Println(res.Value)
	}
}

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0109&lang=jp
"""
import sys


def solve(exp):
    exp = exp.replace('=', '')
    exp = exp.replace('/', '//')
    return eval(exp)


def main(args):
    n = int(input())
    for _ in range(n):
        expression = input().strip()
        result = solve(expression)
        print(result)


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

Python: import sys
import re
#from me.io import dup_file_stdin

#@dup_file_stdin
def solve():
    for _ in range(int(sys.stdin.readline())):
        expr = sys.stdin.readline()[:-1].strip("=")
        expr = re.sub(r"\.\d+","",expr)
        print(eval(expr.replace("/","//")))
 
solve()

Python: import re
class c(int):
    def __add__(self,n):
        return c(int(self)+int(n))
    def __sub__(self,n):
        return c(int(self)-int(n))
    def __mul__(self,n):
        return c(int(self)*int(n))
    def __truediv__(self,n):
        return c(int(int(self)/int(n)))
  
for _ in range(int(input())):
    print(eval(re.sub(r'(\d+)',r'c(\1)',input()[:-1])))

Python: import sys

while True:
    line = raw_input()
    if line == '':
        break

    for i in range(int(line)):
        a = eval(raw_input().replace('/', '//')[:-1])
        sys.stderr.write(a)

Python: n=int(input())
for i in range(n):
    s=input()
    print(s)

Python: import re
#from me.io import dup_file_stdin

#@dup_file_stdin
def solve():
    for _ in range(int(sys.stdin.readline())):
        expr = sys.stdin.readline()[:-1].strip("=")
        expr = re.sub(".d+","",expr)
        print(eval(expr.replace("/","//")))
 
solve()

Python: n=int(input())
for i in range(n):print(eval(input()[:-1].replace('/','//')))

Python: [print(eval(input()[:-1])) for _ in range(int(input()))]

Python: # -*- coding: utf-8 -*-

import sys
import os

n = int(input())

for i in range(n):
    command = input().strip()
    command = command.replace('=', '')
    command = command.replace('/', '//')
    #print(command)
    print(int(eval(command)))

Python: R={"*":2,"/":2,"+":1,"-":1,"(":0,")":0}
for _ in[0]*int(input()):
 L=[];t=''
 for e in input()[:-1]:
  if e.isdigit():t+=e
  else:
   if t:L+=[t];t=''
   L+=e
 if t:L+=[t]
 P,S=[],[]
 for i in L:
  if"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  elif i in R:
   while S and R[S[-1]]>=R[i]:P+=S.pop()
   S+=i
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:S+=[str(int(eval(S.pop(-2)+x+S.pop())))if x in"+-*/"else x]
 print(*S)

Python: import sys

input()
for i in sys.stdin.readlines():
        print(eval(i[:-2]))

Python: import re
class c(int):
    def __add__(self,n):
        return c(int(self)+int(n))
    def __sub__(self,n):
        return c(int(self)-int(n))
    def __mul__(self,n):
        return c(int(self)*int(n))
    def __truediv__(self,n):
        return c(int(int(self)/int(n)))
n = int(input())
for i in range(n):
    print(eval(re.sub(r'(\d+)',r'c(\1)',input()[:-1])))

Python: def ReversePolishNotation(string):

    priority = {"Sentinel": 0, "(": 0, "+": 1, "-": 1, "*": 2, "/": 2}

    stack = []
    signStack = ["Sentinel"]
    isContinue = False

    for item in string[:-1]:

        if str.isnumeric(item):
            if not isContinue:
                stack.append(item)
                isContinue = True
            else:
                stack[-1] += item
            continue
        elif item == "(":
            signStack.append(item)
        elif item == ")":
            while signStack[-1] != "(":
                stack.append(signStack.pop())
            signStack.pop()
        else:
            if priority[item] <= priority[signStack[-1]]:
                while signStack[-1] != "(" and signStack[-1] != "Sentinel":
                    stack.append(signStack.pop())

            signStack.append(item)

        isContinue = False

    while signStack[-1] != "Sentinel":
        stack.append(signStack.pop())

    return stack


def Calculate(formulaList):

    signs = ["+", "-", "*", "/"]

    stack = []

    for item in formulaList:

        if item not in signs:
            stack.append(item)
        else:
            num1 = int(stack.pop())
            num2 = int(stack.pop())

            result = 0

            if item == "+":
                result = num2 + num1
            elif item == "-":
                result = num2 - num1
            elif item == "*":
                result = num2 * num1
            else:
                result = num2 / num1 // 1

            stack.append(result)

    return int(stack[0])


inputCount = int(input())

for lp in range(inputCount):
    formula = input()

    rpn = ReversePolishNotation(formula)
    answer = Calculate(rpn)

    print(answer)

Python: import re
import decimal

def main():
    decimal.getcontext().rounding = decimal.ROUND_DOWN
    n = int(input())
    for i in range(n):
        s = input()
        s = re.sub(r'(\d+)', r'decimal.Decimal(\1)', s).replace('=', '').replace('/', '//')
        print(int(eval(s)))

main()

Python: import re
class c(int):
 def __add__(self,n):return c(int(self)+int(n))
 def __sub__(self,n):return c(int(self)-int(n))
 def __mul__(self,n):return c(int(self)*int(n))
 def __truediv__(self,n):return c(int(int(self)/int(n)))
for _ in[0]*int(input()):print(eval(re.sub(r'(\d+)',r'c(\1)',input()[:-1])))

Python: n = int(input())
for i in range(n):
    eq = input().replace("/","//")
    print(eval(eq))

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0109&lang=jp
"""
import sys
import re


def solve(exp):
    exp = exp.replace('=', '')
    exp = exp.replace('/', '//')
    return eval(exp)


def solve2(exp):
    exp = exp.replace('=', '')
    p = re.compile('(-*\d)/(\d)')
    return eval((p.sub(r'int(\1/\2)', exp)))


def main(args):
    n = int(input())
    for _ in range(n):
        expression = input().strip()
        result = solve2(expression)
        print(result)


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