Language: C++

#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <string>
#include <stack>
#include <cstring>
#include <set>
#include <map>
#include <climits>
#include <cassert>
using namespace std;
 
long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;
 
void insertionSort(int A[], int n, int g) {
  for (int i = g; i < n; ++i) {
    int v = A[i];
    int j = i - g;
    while (j >= 0 && A[j] > v) {
      A[j + g] = A[j];
      j -= g;
      cnt++;
    }
    A[j + g] = v;
  }
}
 
void shellSort(int A[], int n) {
  for (int h = 1; h <= n; h = 3*h + 1)
    G.push_back(h);
  for (int i = G.size() - 1; i >= 0; --i)
    insertionSort(A, n, G[i]);
}

int main(){
    stack<int> S;
    int a,b,x;
    string s;
    while(cin>>s){
        if (s[0] == '+'){
            a = s.top();s.pop();
            b = s.top();s.pop();
            s.push(a+b);
        }
        else if (s[0] == '-'){
            a = s.top();s.pop();
            b = s.top();s.pop();
            s.push(a-b);
        }
        else if (s[0] == '*'){
            a = s.top();s.pop();
            b = s.top();s.pop();
            s.push(a*b);
        }
        else{
            s.push(atoi(s.c_str());
        }
    }
    cout<<s.top();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   53 |             a = s.top();s.pop();
      |                   ^~~
a.cc:53:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   53 |             a = s.top();s.pop();
      |                           ^~~
a.cc:54:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   54 |             b = s.top();s.pop();
      |                   ^~~
a.cc:54:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   54 |             b = s.top();s.pop();
      |                           ^~~
a.cc:55:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   55 |             s.push(a+b);
      |               ^~~~
a.cc:58:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   58 |             a = s.top();s.pop();
      |                   ^~~
a.cc:58:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   58 |             a = s.top();s.pop();
      |                           ^~~
a.cc:59:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   59 |             b = s.top();s.pop();
      |                   ^~~
a.cc:59:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   59 |             b = s.top();s.pop();
      |                           ^~~
a.cc:60:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   60 |             s.push(a-b);
      |               ^~~~
a.cc:63:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   63 |             a = s.top();s.pop();
      |                   ^~~
a.cc:63:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   63 |             a = s.top();s.pop();
      |                           ^~~
a.cc:64:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   64 |             b = s.top();s.pop();
      |                   ^~~
a.cc:64:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   64 |             b = s.top();s.pop();
      |                           ^~~
a.cc:65:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   65 |             s.push(a*b);
      |               ^~~~
a.cc:68:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   68 |             s.push(atoi(s.c_str());
      |               ^~~~
a.cc:68:35: error: expected ')' before ';' token
   68 |             s.push(atoi(s.c_str());
      |                   ~               ^
      |                                   )
a.cc:71:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top'
   71 |     cout<<s.top();
      |             ^~~