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: 
def solve(s):

    def expr(l):
        left, mid = term(l)
        return edum(mid, left)
    
    def edum(l, lval):
        if s[l] == '+':
            val, mid = term(l + 1)
            return edum(mid, lval + val)
        if s[l] == '-':
            val, mid = term(l + 1)
            return edum(mid, lval - val)
        else:
            return lval, l
    
    def term(l):
        left, mid = value(l)
        return tdum(mid, left)

    def tdum(l, lval):
        if s[l] == '*':
            l += 1
            val1, mid = value(l)
            return tdum(mid, lval * val1)
        if s[l] == '/':
            l += 1
            val1, mid = value(l)
            return tdum(mid, (abs(lval) // abs(val1)) * (-1 if (lval < 0) ^ (val1 < 0) else 1))
        else:
            return lval, l

    def value(l):
        if s[l] == '(':
            val1, mid = expr(l + 1)
            return val1, mid + 1
        else:
            val = 0
            fl =  s[l] == '-'
            if fl:
                l += 1
            while s[l].isdecimal():
                val *= 10
                val += int(s[l])
                l += 1
            if fl:
                val *= -1
            return val, l

    res = expr(0)[0]
    """
    gnd = eval(''.join(s[:-1]).replace('/', '//'))
    while res != gnd:
        pass
    """
    print(res)

def main():
    q = int(input())
    for _ in range(q):
        solve(list(input()))

if __name__ == '__main__':
    main()

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 in'*/+-':
   while S and r[S[-1]]>=r[i]:P+=S.pop()
   S+=i
  elif"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:
  if x in'+-*/':t=S.pop();S+=[str(int(eval(S.pop()+x+t)))]
  else:S+=[x]
 print(*S)

Python: import re
n = int(input())
for _ in range(n):
    expr = input()[0:-1]
    print(eval(expr))

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

Python: import sys

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

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

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

Python: #!/usr/bin/python3

import re

class Num:
    def __init__(this, x):
        this.x = x

    def __str__(this):
        return str(this.x)

    def __add__(this, that):
        return Num(this.x + that.x)

    def __sub__(this, that):
        return Num(this.x - that.x)

    def __truediv__(this, that):
        return Num(int(this.x / that.x))

    def __mul__(this, that):
        return Num(this.x * that.x)

    def __neg__(this):
        return Num(-this.x)

n = int(input())
for _ in range(n):
    expr = input()[0:-1]
    expr = re.sub(r'(\d+)', r'Num(\1)', expr)
    print(eval(expr))

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

Python: def f(s):
  while 1:
    b=s.find(")")
    if b<0: return g(s)
    a=s[:b].rfind("(")
    s=s.replace(s[a:b+1],f(s[a+1:b]))

def g(s):
  a=""
  f=1
  x=[]
  def F(a,b):
    x.append(a)
    x.append(b)
    return 1,""
  for c in s:
    if c=="=": continue
    elif c in "*/": f,a=F(a,c)
    elif c in "+-":
      if f==1: f,a=0,c
      else: f,a=F(a,c)
    else: f,a=0,a+c
  x.append(a)

  s=x[:]
  x=[]
  f=""
  for e in s:
    if e in "+-": x.append(e)
    elif e in "*/": f=e
    else:
      a=int(e)
      if f=="*": a*=x.pop()
      elif f=="/": a=int(1.0*x.pop()/a)
      x.append(a)
      f=""

  a,f=0,1
  for e in x:
    if e=="+": f=1
    elif e=="-": f=-1
    else: a+=f*e
  return str(a)

Python: from collections import deque
from sys import stderr

def eva(l, r, op):
    if op == "+":
        return l + r
    elif op == "-":
        return l - r
    elif op == "*":
        return l * r
    elif op == "/":
        return l // r


def calc(exp):
    try:
        i = 0
        num = deque()
        ops = deque()
        ope = ""
        while i < len(exp):
            if exp[i] == '(':
                end = 1
                s = 1
                while True:
                    if exp[i+end] == "(":
                        s += 1
                    elif exp[i+end] == ")":
                        s -= 1
                    if s == 0:
                        break
                    end += 1
                num.append(calc(exp[i+1:i+end]))
                i += end
                if ope:
                    l = num.pop()
                    r = num.pop()
                    num.append(eva(l, r, ope))
                    ope = ""
            if exp[i] in ["*", "/"]:
                ope = exp[i]
            elif exp[i] in ["+", "-"]:
                ops.append(exp[i])
            elif exp[i] == "=":
                pass
            else:
                temp = ""
                j = 0
                while i + j < len(exp) and exp[i+j].isnumeric():
                    temp += exp[i+j]
                    j += 1
                num.append(int(temp))
                i += j - 1
                if ope:
                    num.append(eva(num.pop(), num.pop(), ope))
                    ope = ""
            i += 1
        while len(ops) != 0:
            l = num.popleft()
            r = num.popleft()
            num.appendleft(eva(l,r,ops.popleft()))
    except:
        stderr.write(exp)
    
    return num[0]


n = int(input())
for i in range(n):
    exp = input()
    print(calc(exp))

Python: n = int(input())
for i in range(n):
    s = input()
    print(eval(s[:-1:]))

Python: from collections import deque

def eva(l, r, op):
    if op == "+":
        return l + r
    elif op == "-":
        return l - r
    elif op == "*":
        return l * r
    elif op == "/":
        return l // r


def calc(exp):
    i = 0
    num = deque()
    ops = deque()
    ope = ""
    while i < len(exp):
        if exp[i] == '(':
            end = 1
            s = 1
            while True:
                if exp[i+end] == "(":
                    s += 1
                elif exp[i+end] == ")":
                    s -= 1
                if s == 0:
                    break
                end += 1
            
            num.append(calc(exp[i+1:i+end]))
            i += end + 1
            if ope:
                l = num.pop()
                r = num.pop()
                num.append(eva(l, r, ope))
                ope = ""
        if exp[i] in ["*", "/"]:
            ope = exp[i]
        elif exp[i] in ["+", "-"]:
            ops.append(exp[i])
        elif exp[i] == "=":
            pass
        else:
            temp = ""
            j = 0
            while i + j < len(exp) and exp[i+j].isnumeric():
                temp += exp[i+j]
                j += 1
            num.append(int(temp))
            i += j - 1
            if ope:
                num.append(eva(num.pop(), num.pop(), ope))
                ope = ""
        i += 1
    while len(ops) != 0:
        l = num.popleft()
        r = num.popleft()
        num.appendleft(eva(l,r,ops.popleft()))
    
    return num[0]


n = int(input())
for i in range(n):
    exp = input()
    print(calc(exp))

Python: import re
n = int(input())
for i in range(n):
    eq = input()
    meq = re.sub(r'([\d*]+)/(\d+)',r'(\1//\2)', eq)
    print(eval(meq.replace("=","")))