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: for _ in range(int(input())):print(int(eval(input()[:-1])))

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: for _ in range(int(input())):
    print(int(eval(input()[:-1].replace('/', '//'))))

Python: import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop
import copy

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001



line = []

def calc_E(left,right):
    global line

    depth = 0
    Q = deque()

    #深さ0の、プラスまたはマイナスを探す(単項の-は無いものとする)
    i = left
    while i <= right:
        if line[i] == '(':
            depth += 1
        elif line[i] == ')':
            depth -= 1

        if depth != 0:
            i += 1
        elif line[i] != '+' and line[i] != '-':
            i += 1
        else:
            Q.append(i)
            i += 1

    if len(Q) == 0:
        return calc_T(left,right)

    tmp = calc_E(left,Q[0]-1)

    while len(Q) > 0:
        loc = Q.popleft()

        tmp_right = None

        if len(Q) == 0:
            tmp_right = calc_T(loc+1,right)
        else:
            tmp_right = calc_T(loc+1,Q[0]-1)

        if line[loc] == '+':
            tmp += tmp_right
        else:
            tmp -= tmp_right

    return tmp


def calc_T(left,right):
    global line

    depth = 0
    Q = deque()

    #深さ0の、*または/を探す
    i = left
    while i <= right:
        if line[i] == '(':
            depth += 1
        elif line[i] == ')':
            depth -= 1

        if depth != 0:
            i += 1
        elif line[i] != '*' and line[i] != '/':
            i += 1
        else:
            Q.append(i)
            i += 1

    if len(Q) == 0:
        return calc_F(left,right)

    tmp = calc_T(left,Q[0]-1)

    while len(Q) > 0:
        loc = Q.popleft()

        tmp_right = None

        if len(Q) == 0:
            tmp_right = calc_F(loc+1,right)
        else:
            tmp_right = calc_F(loc+1,Q[0]-1)

        if line[loc] == '*':
            tmp *= tmp_right
        else: #注意:たとえば(-3//2はpython3では-2になる模様)
            if tmp*tmp_right > 0:
                tmp = abs(tmp)//abs(tmp_right)
            else:
                tmp = abs(tmp)//abs(tmp_right)
                tmp *= -1

    return tmp


def calc_F(left,right):
    if line[left].isdecimal():
        return calc_NUM(left,right)
    elif line[left] == '(':

        depth = 0
        close_pos = None

        for i in range(left,right+1):
            if line[i] == '(':
                depth += 1
            elif line[i] == ')':
                depth -= 1
                if depth == 0:
                    close_pos = i
                    break

        return calc_E(left+1,close_pos-1)

def calc_NUM(left,right):
    global line
    ret = 0

    for i in range(left,right+1):
        ret = 10*ret+int(line[i])

    return ret

N = int(input())

for _ in range(N):
    line = str(input())
    print("%d"%(calc_E(0,len(line)-2)))

Python: def ReversePolishNotation(string):

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

    stack = []
    signStack = ["Sentinel"]

    for item in string[:-1]:
        if item == "(":
            signStack.append(item)
        elif item == ")":
            while signStack[-1] != "(":
                stack.append(signStack.pop())
            signStack.pop()
        else:
            if item in priority.keys():
                if priority[signStack[-1]] < priority[item]:
                    signStack.append(item)
                else:
                    top = signStack.pop()
                    stack.append(top)
                    signStack.append(item)
            else:
                stack.append(item)

    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
                result = int(result)

            stack.append(result)

    return int(stack[0])


inputCount = int(input())

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

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

    print(str(answer))

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

Python: def calc(eqt):
  l = eqt.split("+",maxsplit=1)
  if len(l) == 2:
    return (calc(l[0])+calc(l[1]))
  l = eqt.split("-",maxsplit=1)
  if len(l) == 2:
    return (calc(l[0])-calc(l[1]))
  l = eqt.split("*",maxsplit=1)
  if len(l) == 2:
    return (calc(l[0])*calc(l[1]))
  l = eqt.split("/",maxsplit=1)
  if len(l) == 2:
    return (calc(l[0])//calc(l[1]))
  return (int(eqt))

def unfold_brackets(eqt):
  l = eqt.split(')',maxsplit=1)
  if len(l) == 1:
    return calc(eqt)
  else:
    ll = l[0].rsplit('(',maxsplit=1)
    ll.append(l[1])
    ll[1] = str(calc(ll[1]))
    l="".join(ll)
    return unfold_brackets(l)

n=int(input())
datasets=[input() for i in range(n)]
for line in datasets:
  l = line.split("=",maxsplit=1)[0]
  print(unfold_brackets(l))

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

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,brac=None):
    i = 0 # ループカウンタ?
    num = deque() # 数字をためておく
    ops = deque() # +-をためておく
    ope = "" # */を保存
    
    if not brac:
        # 対応する括弧の位置を記録しておいて計算量を削減
        brac = [-1 for j in range(len(exp))]
        tmpbrac = []
        for j in range(len(exp) - 1, 0, -1):
            if exp[j] == ')':
                tmpbrac.append(j)
            elif exp[j] == '(':
                brac[j] = tmpbrac.pop()

    # かっこの中身と乗除算
    while i < len(exp):
        # かっこの中身は再帰的に計算
        if exp[i] == '(':
            num.append(calc(exp[i + 1:brac[i]],brac))
            i = brac[i]
            if ope:
                r = num.pop()
                l = num.pop()
                num.append(eva(l, r, ope))
                ope = ""
        elif exp[i] in ["*", "/"]:
            ope = exp[i]
        elif exp[i] in ["+", "-"]:
            ops.append(exp[i])
        elif exp[i] == "=":
            pass
        else:
            temp = exp[i] # 数値 2桁以上にも対応させる
            i += 1
            while i < len(exp) and exp[i].isnumeric():
                temp += exp[i]
                i += 1
            i -= 1 # 最後の数字に戻る(最後にi+=1しているのでこれでいい)
            num.append(int(temp))
            if ope:
                r = num.pop()
                l = num.pop()
                num.append(eva(l, r, ope))
                ope = ""
        i += 1
    while len(ops) != 0:
        num.appendleft(eva(num.popleft(),num.popleft(),ops.popleft()))

    return num[0]


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