Language: C++

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

typedef long long ll;

ll stol(string s){
  stringstream ss(s);
  ll n;
  ss >> n;
  return n;
}

ll parse(int l, int r){
  int n = 0,i;
  for(i=r-1;i>=l;i--){
    if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
    if(!n){
      if(s[i] == ‘+’)return parse(l,i)+parse(i+1,r);
      if(s[i] == ‘-’)return parse(l,i)-parse(i+1,r);
    }
  }
  for(i=r-1;i>=l;i--){
    if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
    if(!n){
      if(s[i] == ‘*’)return parse(l,i)*parse(i+1,r);
      if(s[i] == ‘/’)return parse(l,i)/parse(i+1,r);
    }
  }

  if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
  return stol(s.substr(l,r-l));
}

int main(){
  int n;
  string s;
  cin >> n;
  while(n--){
    cin >> s;
    cout << parse(0,(int)s.size()-1) << endl;
  }
}

Compiler output:
a.cc:18:16: error: extended character ‘ is not valid in an identifier
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                ^
a.cc:18:18: error: extended character ‘ is not valid in an identifier
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                  ^
a.cc:18:37: error: extended character ‘ is not valid in an identifier
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                     ^
a.cc:18:39: error: extended character ’ is not valid in an identifier
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                       ^
a.cc:20:18: error: extended character ‘ is not valid in an identifier
   20 |       if(s[i] == ‘+’)return parse(l,i)+parse(i+1,r);
      |                  ^
a.cc:20:20: error: extended character ’ is not valid in an identifier
   20 |       if(s[i] == ‘+’)return parse(l,i)+parse(i+1,r);
      |                    ^
a.cc:21:18: error: extended character ‘ is not valid in an identifier
   21 |       if(s[i] == ‘-’)return parse(l,i)-parse(i+1,r);
      |                  ^
a.cc:21:20: error: extended character ’ is not valid in an identifier
   21 |       if(s[i] == ‘-’)return parse(l,i)-parse(i+1,r);
      |                    ^
a.cc:25:16: error: extended character ‘ is not valid in an identifier
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                ^
a.cc:25:18: error: extended character ‘ is not valid in an identifier
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                  ^
a.cc:25:37: error: extended character ‘ is not valid in an identifier
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                     ^
a.cc:25:39: error: extended character ’ is not valid in an identifier
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                       ^
a.cc:27:18: error: extended character ‘ is not valid in an identifier
   27 |       if(s[i] == ‘*’)return parse(l,i)*parse(i+1,r);
      |                  ^
a.cc:27:20: error: extended character ’ is not valid in an identifier
   27 |       if(s[i] == ‘*’)return parse(l,i)*parse(i+1,r);
      |                    ^
a.cc:28:18: error: extended character ‘ is not valid in an identifier
   28 |       if(s[i] == ‘/’)return parse(l,i)/parse(i+1,r);
      |                  ^
a.cc:28:20: error: extended character ’ is not valid in an identifier
   28 |       if(s[i] == ‘/’)return parse(l,i)/parse(i+1,r);
      |                    ^
a.cc:32:14: error: extended character ‘ is not valid in an identifier
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |              ^
a.cc:32:16: error: extended character ‘ is not valid in an identifier
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |                ^
a.cc:32:31: error: extended character ‘ is not valid in an identifier
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |                               ^
a.cc:32:33: error: extended character ’ is not valid in an identifier
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |                                 ^
a.cc: In function 'll parse(int, int)':
a.cc:18:8: error: 's' was not declared in this scope
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |        ^
a.cc:18:16: error: '\U00002018' was not declared in this scope
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                ^
a.cc:18:19: error: expected ';' before ')' token
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                   ^
      |                   ;
a.cc:18:29: error: 's' was not declared in this scope
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                             ^
a.cc:18:39: error: '\U00002019' was not declared in this scope
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                       ^
a.cc:18:37: error: '\U00002018' was not declared in this scope
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                     ^
a.cc:19:5: error: expected primary-expression before 'if'
   19 |     if(!n){
      |     ^~
a.cc:18:45: error: expected ')' before 'if'
   18 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                            ~                ^
      |                                             )
   19 |     if(!n){
      |     ~~                                       
a.cc:23:3: error: expected primary-expression before '}' token
   23 |   }
      |   ^
a.cc:25:8: error: 's' was not declared in this scope
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |        ^
a.cc:25:16: error: '\U00002018' was not declared in this scope
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                ^
a.cc:25:19: error: expected ';' before ')' token
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                   ^
      |                   ;
a.cc:25:29: error: 's' was not declared in this scope
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                             ^
a.cc:25:39: error: '\U00002019' was not declared in this scope
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                       ^
a.cc:25:37: error: '\U00002018' was not declared in this scope
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                                     ^
a.cc:26:5: error: expected primary-expression before 'if'
   26 |     if(!n){
      |     ^~
a.cc:25:45: error: expected ')' before 'if'
   25 |     if(s[i] == ‘)‘)n++;  if(s[i] == ‘(’)n--;
      |                            ~                ^
      |                                             )
   26 |     if(!n){
      |     ~~                                       
a.cc:30:3: error: expected primary-expression before '}' token
   30 |   }
      |   ^
a.cc:32:6: error: 's' was not declared in this scope
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |      ^
a.cc:32:16: error: '\U00002018' was not declared in this scope
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |                ^
a.cc:32:14: error: '\U00002018' was not declared in this scope
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |              ^
a.cc:32:33: error: expected ')' before '\U00002019'
   32 |   if(s[l] == ‘(‘ && s[r-1] == ‘)’)return parse(l+1,r-1);
      |     ~                           ^
      |                                 )
a.cc:33:15: error: 's' was not declared in this scope
   33 |   return stol(s.substr(l,r-l));
      |               ^