Language: C++

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

class Stack{
private:
  int sp;
  int S[100];
public:
  Stack() {sp==0;}
  bool isFull() const {return (sp==100);}
  bool isEmpty() const {return (sp==0);}
  void push(int d){
    if(isFull())
      return;
    S[sp++] = d;
  }
  int top(){
    if(isEmpty())
      return -1;
    return S[sp-1];
  }
  void pop(){
    if(isEmpty())
      return;
    sp--;
  }
};

int main(){
  Stack s;
  string expr;
  getline(cin,expr);

  istringstream is(expr);

  while(!is.eof()){
    string op;
    is >> op;

    int tmp1,tmp2;

    switch(op[0]){
      case '+':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();
        s.push(tmp2+tmp1);
        break;
      case '-':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();
        s.push(tmp2-tmp1);
        break;
      case '*':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();#include<iostream>
#include<string>
#include<sstream>
using namespace std;

class Stack{
private:
  int sp;
  int S[100];
public:
  Stack() {sp==0;}
  bool isFull() const {return (sp==100);}
  bool isEmpty() const {return (sp==0);}
  void push(int d){
    if(isFull())
      return;
    S[sp++] = d;
  }
  int top(){
    if(isEmpty())
      return -1;
    return S[sp-1];
  }
  void pop(){
    if(isEmpty())
      return;
    sp--;
  }
};

int main(){
  Stack s;
  string expr;
  getline(cin,expr);

  istringstream is(expr);

  while(!is.eof()){
    string op;
    is >> op;

    int tmp1,tmp2;

    switch(op[0]){
      case '+':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();
        s.push(tmp2+tmp1);
        break;
      case '-':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();
        s.push(tmp2-tmp1);
        break;
      case '*':
        tmp1 = s.top();s.pop();
        tmp2 = s.top();s.pop();
        s.push(tmp2*tmp1);
        break;
      default:
        istringstream is2(op);
        is2 >> tmp1;
        s.push(tmp1);
        break;
    }
  }
  cout << s.top() << endl;
  return 0;
}

        s.push(tmp2*tmp1);
        break;
      default:
        istringstream is2(op);
        is2 >> tmp1;
        s.push(tmp1);
        break;
    }
  }
  cout << s.top() << endl;
  return 0;
}



Compiler output:
a.cc:57:32: error: stray '#' in program
   57 |         tmp2 = s.top();s.pop();#include<iostream>
      |                                ^
a.cc: In function 'int main()':
a.cc:57:33: error: 'include' was not declared in this scope
   57 |         tmp2 = s.top();s.pop();#include<iostream>
      |                                 ^~~~~~~
a.cc:57:49: error: expected primary-expression before '>' token
   57 |         tmp2 = s.top();s.pop();#include<iostream>
      |                                                 ^
a.cc:60:1: error: expected primary-expression before 'using'
   60 | using namespace std;
      | ^~~~~
a.cc:87:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   87 | int main(){
      |         ^~
a.cc:87:9: note: remove parentheses to default-initialize a variable
   87 | int main(){
      |         ^~
      |         --
a.cc:87:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:87:11: error: a function-definition is not allowed here before '{' token
   87 | int main(){
      |           ^