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

C++: #define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;

static const double EPS = 1e-8;

const int tx[] = {0,1,0,-1};
const int ty[] = {-1,0,1,0};

P equation(const string &str, int pos=0);
P factor(const string &str, int pos = 0);
P term(const string &str, int pos = 0);

P equation(const string &str, int pos){
	P res = factor(str,pos);
	while(str[res.second] == '+' || str[res.second] == '-'){
		P res_ = factor(str,res.second+1);
		if(str[res.second] == '+') res.first += res_.first;
		else res.first -= res_.first;
		res.second = res_.second;
	}
	return res;
}

P factor(const string &str, int pos) {
	P res = term(str, pos);
	while (str[res.second] == '*' || str[res.second] == '/') {
		P res_ = term(str, res.second+1);
		if(str[res.second] == '*') res.first *= res_.first;
		else res.first /= res_.first;
		res.second = res_.second;
	}
	return res;
}

P term(const string &str, int pos) {
	if(str[pos] == '('){
		P res = equation(str,pos+1);
		res.second += 1;
		return res;
	} else {
		int val = 0;
		while(isdigit(str[pos])){
			val = val * 10 + (str[pos++]-'0');
		}
		return P(val,pos);
	}
}


int main(){
	string str;
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		cin>>str;
		P res = equation(str);
		cout << res.first << endl;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;

int exp();
int term();
int factor();
int number();
int digit();

string str;

int p,len,val;

int exp(){
  int val = term();
  while( str[p] == '+' || str[p] == '-' ){
    if( str[p] == '+' ){
      p++;
      val += term();
    }else if( str[p] == '-' ){
      p++;
      val -= term();
    }
  }
  return val;
}

int term(){
  int val=factor();
  while( str[p] == '*' || str[p] == '/' ){
    if( str[p] == '*' ){
      p++;
      val *= factor();
    }else if( str[p] == '/' ){
      p++;
      val /= factor();
    }
  }
  return val;
}

int factor(){
  int val;
  if( str[p] == '(' ){
      p++;
      val =  exp();
      p++;
  }else{
    val = number();
  }

  return val;
}

int number(){
  int val = 0;
  while( digit() ){
    int num = str[p] - '0';
    val = val * 10 + num;
    p++;
  }
  return val;
}

int digit(){
  if( str[p] == '1' || str[p] == '2' || str[p] == '3' || str[p] == '4' ||
      str[p] == '5' || str[p] == '6' || str[p] == '7' || str[p] == '8' ||
      str[p] == '9' || str[p] == '0' ) return 1;
  return 0;
}

  
int main(){
  int n; cin >> n;
  
  for(int i = 0; i < n; i++ ){
    p = 0;
    cin >> str;
    
    int ans = exp();      
    
    cout << ans << endl;
    
  }
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

//<expr>   :: = <term>[('+' | '-') <term>] *
//<term>   :: = <factor>[('*' | '/') <factor>] *
//<factor> :: = <number> | '(' <expr> ')'
//<number> : == 1?????\????????°???


ll number(string& s, ll& i);
ll term(string& s, ll& i);
ll factor(string& s, ll& i);
ll expr(string& s, ll& i);

ll number(string& s, ll& i) {
	ll n = s[i++] - '0';
	while (isdigit(s[i])) n = n * 10 + s[i++] - '0';
	return n;
}

ll factor(string& s, ll& i) {
	if (isdigit(s[i])) return number(s, i);

	// ????????§?§?????????£???????????° s[i] == '(' ??¨??????
	i++; // '('??????????£???°???
	ll ret = expr(s, i);
	i++; // ')'??????????£???°???
	return ret;
}

ll term(string& s, ll& i) {
	ll val = factor(s, i);
	while (s[i] == '*' || s[i] == '/') {
		char op = s[i];
		i++;
		int val2 = factor(s, i);
		if (op == '*') val *= val2;
		else val /= val2;
	}
	return val;
}

ll expr(string& s, ll& i) {
	ll val = term(s, i);
	while (s[i] == '+' || s[i] == '-') {
		char op = s[i];
		i++;
		int val2 = term(s, i);
		if (op == '+') val += val2;
		else val -= val2;
	}
	return val;
}

int n;
ll pos = 0;
string s;

int main() {
	cin >> n;
	REP(i,2){
		cin >> s;
		pos = 0;
		cout << expr(s, pos) << endl;
	}
}

C++: #include <iostream>

int main()
{
std::cout << std::endl;
return 0;
}

C++: #include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
ll inf = llmax / 2;
double eps = 1e-11;

string S = "12+1290";
int cur = 0;

int digit() {
    assert(isdigit(S[cur]));
    int n = S[cur] - '0';
    cur++;
    return n;
}

ll number() {
    ll n = digit();
    while (cur < S.size() && isdigit(S[cur])) {
        n = n * 10 + digit();
    }
    return n;
}

ll expression();

ll factor() {
    if (S[cur] != '(') {
        return number();
    }
    cur++;
    int n = expression();
    assert(S[cur] == ')');
    cur += 1;
    return n;
}

ll term() {
    ll a = factor();
    while (cur < S.size() && (S[cur] == '*' || S[cur] == '/')) {
        char op = S[cur];
        cur++;
        ll b = factor();
        if (op == '*') {
            a *= b;
        } else {
            a /= b;
        }
    }
    return a;
}

ll expression() {
    ll a = term();
    while (cur < S.size() && (S[cur] == '+' || S[cur] == '-')) {
        char op = S[cur];
        cur++;
        ll b = term();
        if (op == '+') {
            a += b;
        } else {
            a -= b;
        }
    }
    return a;
}

int main() {
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> S;
        cur = 0;
        ll ans = expression();
        cout << ans << endl;
    }
}