criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
??
int top,S[101];
??
void push(int x){
????????S[++top] = x;
}
??
int pop(){
????????return S[top--];
}
??
int main(){
????????char str[10];
????????int a,b;
????????top = 0;
??????????
????????while(scanf("%s",str) != EOF){
????????????????if(str[0]=='+'){
????????????????????????a=pop();
????????????????????????b=pop();
????????????????????????push(a+b);
????????????????}else if(str[0]=='-'){
????????????????????????a=pop();
????????????????????????b=pop();
????????????????????????push(b-a);
????????????????}else if(str[0]=='*'){
????????????????????????a=pop();
????????????????????????b=pop();
????????????????????????push(a*b);
????????????????}else{
????????????????????????push(atoi(str));
????????????????}
????????}
????????cout<<pop()<<endl;
}

Compiler output:
a.cc:5:1: error: expected unqualified-id before '?' token
    5 | ??
      | ^
a.cc:7:1: error: expected unqualified-id before '?' token
    7 | ??
      | ^
a.cc:11:1: error: expected unqualified-id before '?' token
   11 | ??
      | ^
a.cc:15:1: error: expected unqualified-id before '?' token
   15 | ??
      | ^
Language: C++

#include <iostream>
#include <string>
#include <stack>
#include <sstream>
#include <cctype>
#include <algorithm>

using namespace std;

int CalcRPN(stack<string>& st) {
    string str = st.top();
    st.pop();

    if (all_of(str.cbegin(), str.cend(), isdigit)) return stoi(str);
    char c = str[0];
    
    switch (c) {
    case '+':
        return CalcRPN(st) + CalcRPN(st);
        break;
    case '-':
        return -CalcRPN(st) + CalcRPN(st);
        break;
    case '*':
        return CalcRPN(st) * CalcRPN(st);
        break;
    }
}

int main() {
    string str;
    getline(cin, str);

    stack<string> st;
    stringstream ss(str);
    string item;
    while (getline(ss, item, ' ')) {
        st.push(item);
    }
    
    cout << CalcRPN(st) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int CalcRPN(std::stack<std::__cxx11::basic_string<char> >&)':
a.cc:14:15: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::const_iterator, std::__cxx11::basic_string<char>::const_iterator, <unresolved overloaded function type>)'
   14 |     if (all_of(str.cbegin(), str.cend(), isdigit)) return stoi(str);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:14:15: note:   couldn't deduce template parameter '_Predicate'
   14 |     if (all_of(str.cbegin(), str.cend(), isdigit)) return stoi(str);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <stack>
#include <sstream>
#include <cctype>
#include <algorithm>

using namespace std;

int CalcRPN(stack<string>& st) {
    string str = st.top();
    st.pop();
    
    char c = str[0];
    
    switch (c) {
    case '+':
        return CalcRPN(st) + CalcRPN(st);
        break;
    case '-':
        return -CalcRPN(st) + CalcRPN(st);
        break;
    case '*':
        return CalcRPN(st) * CalcRPN(st);
        break;
    default:
        return stoi(str);
    }
}

int main() {
    string str;
    getline(cin, str);

    stack<string> st;
    stringstream ss(str);
    string item;
    while (getline(ss, item, ' ')) {
        st.push(item);
    }
    
    cout << CalcRPN(st) << endl;

    return 0;
}
    stack<string> st;
    stringstream ss(str);
    string item;
    while (getline(ss, item, ' ')) {
        st.push(item);
    }
    
    cout << CalcRPN(st) << endl;

    return 0;
}

Compiler output:
a.cc:47:21: error: 'str' was not declared in this scope; did you mean 'std'?
   47 |     stringstream ss(str);
      |                     ^~~
      |                     std
a.cc:49:5: error: expected unqualified-id before 'while'
   49 |     while (getline(ss, item, ' ')) {
      |     ^~~~~
a.cc:53:5: error: 'cout' does not name a type
   53 |     cout << CalcRPN(st) << endl;
      |     ^~~~
a.cc:55:5: error: expected unqualified-id before 'return'
   55 |     return 0;
      |     ^~~~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	stack<long long>st;
	char c;
	while(scanf("%s",c)!=EOF){
		if(c=='+'){
			long long a=st.top();
			st.pop();
			long long b=st.top();
			st.pop();
			st.push(a+b);
		}
		if(c=='-'){
			long long a=st.top();
			st.pop();
			long long b=st.top();
			st.pop();
			st.push(a-b);
		}
		if(c=='*'){
			long long a=st.top();
			st.pop();
			long long b=st.top();
			st.pop();
			st.push(a*b);
		}
		if(c=='/'){
			long long a=st.top();
			st.pop();
			long long b=st.top();
			st.pop();
			st.push(a/b);
		}
		else{
			st.push(atoi(c));
		}
	}
	cout<<st.top()<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:38: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   37 |                         st.push(atoi(c));
      |                                      ^
      |                                      |
      |                                      char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

int main() {
    stack<int> operands;
    vector<string> inputs;
    string cur;
    while (!cin.eof()) {
        cin >> cur;
        inputs.push_back(cur);
    }   

    for (int i = 0; i < (int) inputs.size(); ++i) {
        string cur = inputs[i];
        if (is_digit(cur)) {
            operands.push(atoi(cur.c_str()));
        } else {
            int operand_1 = operands.top();
            operands.pop();
            int operand_2 = operands.top();
            operands.pop();
            char oprt = cur[0];
            operands.push(compute(oprt, operand_2, operand_1));
        }   
    }   

    cout << operands.top() << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'stack' was not declared in this scope
    2 |     stack<int> operands;
      |     ^~~~~
a.cc:2:11: error: expected primary-expression before 'int'
    2 |     stack<int> operands;
      |           ^~~
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<string> inputs;
      |     ^~~~~~
a.cc:3:12: error: 'string' was not declared in this scope
    3 |     vector<string> inputs;
      |            ^~~~~~
a.cc:3:20: error: 'inputs' was not declared in this scope
    3 |     vector<string> inputs;
      |                    ^~~~~~
a.cc:4:11: error: expected ';' before 'cur'
    4 |     string cur;
      |           ^~~~
      |           ;
a.cc:5:13: error: 'cin' was not declared in this scope
    5 |     while (!cin.eof()) {
      |             ^~~
a.cc:6:16: error: 'cur' was not declared in this scope
    6 |         cin >> cur;
      |                ^~~
a.cc:11:15: error: expected ';' before 'cur'
   11 |         string cur = inputs[i];
      |               ^~~~
      |               ;
a.cc:12:22: error: 'cur' was not declared in this scope
   12 |         if (is_digit(cur)) {
      |                      ^~~
a.cc:12:13: error: 'is_digit' was not declared in this scope
   12 |         if (is_digit(cur)) {
      |             ^~~~~~~~
a.cc:13:13: error: 'operands' was not declared in this scope
   13 |             operands.push(atoi(cur.c_str()));
      |             ^~~~~~~~
a.cc:13:27: error: 'atoi' was not declared in this scope
   13 |             operands.push(atoi(cur.c_str()));
      |                           ^~~~
a.cc:15:29: error: 'operands' was not declared in this scope; did you mean 'operand_1'?
   15 |             int operand_1 = operands.top();
      |                             ^~~~~~~~
      |                             operand_1
a.cc:20:27: error: 'compute' was not declared in this scope
   20 |             operands.push(compute(oprt, operand_2, operand_1));
      |                           ^~~~~~~
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout << operands.top() << endl;
      |     ^~~~
a.cc:24:13: error: 'operands' was not declared in this scope
   24 |     cout << operands.top() << endl;
      |             ^~~~~~~~
a.cc:24:31: error: 'endl' was not declared in this scope
   24 |     cout << operands.top() << endl;
      |                               ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <memory>
#include <stdlib.h>
using namespace std;

stack<int> a;
void solve();
int main(){
    //freopen("/Users/mac/Desktop/C++?¨????/test/test.txt", "r", stdin);
    solve();
    cout<<a.top()<<endl;
    return 0;
}
void solve()
{
    char c[10];
    while (cin>>c) {
        if (strncmp(c, "+", 1)==0) {
            int n1,n2,n3;
            n2=a.top();
            a.pop();
            n1=a.top();
            a.pop();
            n3=n1+n2;
            a.push(n3);
        }
        else if (strncmp(c, "-", 2)==0) {
            int n1,n2,n3;
            n2=a.top();
            a.pop();
            n1=a.top();
            a.pop();
            n3=n1-n2;
            a.push(n3);
        }
        else if (strncmp(c, "*", 1)==0) {
            int n1,n2,n3;
            n2=a.top();
            a.pop();
            n1=a.top();
            a.pop();
            n3=n1*n2;
            a.push(n3);
        }
        else if (strncmp(c, "/", 1)==0) {
            int n1,n2,n3;
            n2=a.top();
            a.pop();
            n1=a.top();
            a.pop();
            n3=n1/n2;
            a.push(n3);
        }
        else{
            int n=atoi(c);
            a.push(n);
        }
    }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:25:13: error: 'strncmp' was not declared in this scope
   25 |         if (strncmp(c, "+", 1)==0) {
      |             ^~~~~~~
a.cc:11:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <stdlib.h>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include <ctype.h>
#include <cassert>
#include <cstdio>

using namespace std;

namespace {

int stackptr = -1;
int stack[100];

inline int Pop() {
  return stack[stackptr--];
}

inline void Push(int n) {
  stackptr++;
  stack[stackptr] = n;
}

}  // namespace

int main() {
  char buf[1000000];
  while (scanf("%s", buf) != EOF) {
    const char* p = buf;
    if (isspace(*p))
      continue;
    if (isdigit(*p)) {
      Push(atoi(p));
      continue;
    }

    switch (*p) {
      case '+':
        Push(Pop() + Pop());
        break;
      case '-': {
        const int b = Pop();
        const int a = Pop();
        Push(a - b);
      } break;
      case '*':
        Push(Pop() * Pop());
        break;
      default:
        assert(false);
    }
  }

  printf("%d\n", stack[0]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: 'atoi' was not declared in this scope
   30 |       Push(atoi(p));
      |            ^~~~
Language: C++

#include <ctype.h>
#include <cassert>
#include <cstdio>
#include <ctdlib>

using namespace std;

namespace {

int stackptr = -1;
int stack[100];

inline int Pop() {
  return stack[stackptr--];
}

inline void Push(int n) {
  stackptr++;
  stack[stackptr] = n;
}

}  // namespace

int main() {
  char buf[1000000];
  while (scanf("%s", buf) != EOF) {
    const char* p = buf;
    if (isspace(*p))
      continue;
    if (isdigit(*p)) {
      Push(atoi(p));
      continue;
    }

    switch (*p) {
      case '+':
        Push(Pop() + Pop());
        break;
      case '-': {
        const int b = Pop();
        const int a = Pop();
        Push(a - b);
      } break;
      case '*':
        Push(Pop() * Pop());
        break;
      default:
        assert(false);
    }
  }

  printf("%d\n", stack[0]);
  return 0;
}

Compiler output:
a.cc:4:10: fatal error: ctdlib: No such file or directory
    4 | #include <ctdlib>
      |          ^~~~~~~~
compilation terminated.
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);
	int top();
	void pop();
};

void Stack::push(int d)
{
	if(isFull())
		return;
	
	S[sp++]=s;
}
int Stack::top()
{
	if(isEmpty())
		return -1;
	
	return S[sp-1];
}

void Stack::pop()
{
	if(isEmpty)())
		return;

	sp--;
}

int main()
{
	Stack s;
	
	string expr;
	getline(cin,expr);
	
	istingstream 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;
}

Compiler output:
a.cc:6:13: error: expected unqualified-id before ')' token
    6 | class Stack(){
      |             ^
a.cc:19:23: error: invalid use of incomplete type 'class Stack'
   19 | void Stack::push(int d)
      |                       ^
a.cc:6:7: note: forward declaration of 'class Stack'
    6 | class Stack(){
      |       ^~~~~
a.cc:26:16: error: invalid use of incomplete type 'class Stack'
   26 | int Stack::top()
      |                ^
a.cc:6:7: note: forward declaration of 'class Stack'
    6 | class Stack(){
      |       ^~~~~
a.cc:34:17: error: invalid use of incomplete type 'class Stack'
   34 | void Stack::pop()
      |                 ^
a.cc:6:7: note: forward declaration of 'class Stack'
    6 | class Stack(){
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:44:15: error: aggregate 'Stack s' has incomplete type and cannot be defined
   44 |         Stack s;
      |               ^
a.cc:49:9: error: 'istingstream' was not declared in this scope
   49 |         istingstream is(expr);
      |         ^~~~~~~~~~~~
a.cc:51:16: error: 'is' was not declared in this scope
   51 |         while(!is.eof()){
      |                ^~
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);
	int top();
	void pop();
};

void Stack::push(int d)
{
	if(isFull())
		return;
	
	S[sp++]=s;
}
int Stack::top()
{
	if(isEmpty())
		return -1;
	
	return S[sp-1];
}

void Stack::pop()
{
	if(isEmpty)())
		return;

	sp--;
}

int main()
{
	Stack s;
	
	string expr;
	getline(cin,expr);
	
	istingstream 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;
}

Compiler output:
a.cc: In member function 'bool Stack::isFull() const':
a.cc:12:37: error: 'sP' was not declared in this scope; did you mean 'sp'?
   12 |         bool isFull() const{return (sP==100);}
      |                                     ^~
      |                                     sp
a.cc: In member function 'void Stack::push(int)':
a.cc:24:17: error: 's' was not declared in this scope
   24 |         S[sp++]=s;
      |                 ^
a.cc: In member function 'void Stack::pop()':
a.cc:36:19: error: cannot convert 'Stack::isEmpty' from type 'bool (Stack::)() const' to type 'bool'
   36 |         if(isEmpty)())
      |                   ^
a.cc:36:21: error: expected primary-expression before ')' token
   36 |         if(isEmpty)())
      |                     ^
a.cc: In function 'int main()':
a.cc:49:9: error: 'istingstream' was not declared in this scope
   49 |         istingstream is(expr);
      |         ^~~~~~~~~~~~
a.cc:51:16: error: 'is' was not declared in this scope; did you mean 's'?
   51 |         while(!is.eof()){
      |                ^~
      |                s
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <list>
#include <algorythm>
#include <ctype.h>
using namespace std;

int main(int argc, char** argv) {

    list<int> l;
    l.push_back(0);
    list<int>::iterator top=l.begin();
    
    string expr;
	getline(cin,expr);
	istringstream is(expr);
    int x,y;
    while(!is.eof()){
        string op;
		 is>>op;
        if(all_of(op.cbegin(),op.cend().isdigit)){
            x=static_cast<int>(a);
            l.push_back(a);
            top++;
        }else{
            switch(op[0]){
                case '+':
                    y=*top;
                    top--;
                    l.pop_back();
                    x=*top;
                    top--;
                    l.pop_back();
                    l.push_back(x+y);
                    top++;
                    break;
                case '-':
                    y=*top;
                    top--;
                    l.pop_back();
                    x=*top;
                    top--;
                    l.pop_back();
                    l.push_back(x-y);
                    top++;
                    break;
                case '*':
                    y=*top;
                    top--;
                    l.pop_back();
                    x=*top;
                    top--;
                    l.pop_back();
                    l.push_back(x*y);
                    top++;
                    break;
            }
        }
    }
    cout<<*top<<endl;
    return 0;
}

Compiler output:
a.cc:5:10: fatal error: algorythm: No such file or directory
    5 | #include <algorythm>
      |          ^~~~~~~~~~~
compilation terminated.
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);
 int top();
 void pop();
};

void Stack::push(int d){
 if(isFull())
	return ;

 S[sp++]=d;
}
int Stack::top(){
 if(isEmpty())
	return -1;

 return S[sp-1];
}
void Stack::pop(){
 if(isEmpty())
	return;
 sp--;
}

int main(){
 Stack s;
 stringexpr;
 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;
}

Compiler output:
a.cc: In member function 'void Stack::push(int)':
a.cc:21:5: error: 'isFull' was not declared in this scope; did you mean 'isFULL'?
   21 |  if(isFull())
      |     ^~~~~~
      |     isFULL
a.cc: In function 'int main()':
a.cc:40:2: error: 'stringexpr' was not declared in this scope
   40 |  stringexpr;
      |  ^~~~~~~~~~
a.cc:41:14: error: 'expr' was not declared in this scope
   41 |  getline(cin,expr);
      |              ^~~~
a.cc:73:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   73 |  cout<s.top()<<endl;
      |       ~~~~~~~^~~~~~
Language: C++

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

class Stack{
private:
	int sp;
	int S[100];
public:
	Stack(){
		xp=0;
	}
	bool ixFull() const{
		return(sp==100);
	}
	bool isEmpty() const{
		return(sp==0);
	}
	void push(int d);
	int top();
	void pop();
};

void Stack::push(int d)
{
	if(isFull())
		return;
	S[sp++]=d;
}
void Stack::top()
{
	if(isEmpty())
		return-1;

}
void Stack::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;
}

Compiler output:
a.cc: In constructor 'Stack::Stack()':
a.cc:12:17: error: 'xp' was not declared in this scope; did you mean 'sp'?
   12 |                 xp=0;
      |                 ^~
      |                 sp
a.cc: In member function 'void Stack::push(int)':
a.cc:27:12: error: 'isFull' was not declared in this scope; did you mean 'ixFull'?
   27 |         if(isFull())
      |            ^~~~~~
      |            ixFull
a.cc: At global scope:
a.cc:31:6: error: no declaration matches 'void Stack::top()'
   31 | void Stack::top()
      |      ^~~~~
a.cc:21:13: note: candidate is: 'int Stack::top()'
   21 |         int top();
      |             ^~~
a.cc:6:7: note: 'class Stack' defined here
    6 | class Stack{
      |       ^~~~~
Language: C++

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

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

void Stack::push(int d)
{
	if(isFull())
		return;
	S[sp++]=d;
}
void Stack::top()
{
	if(isEmpty())
		return-1;
	return S[sp-1];

}
void Stack::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;
}

Compiler output:
a.cc: In member function 'void Stack::push(int)':
a.cc:27:12: error: 'isFull' was not declared in this scope; did you mean 'ixFull'?
   27 |         if(isFull())
      |            ^~~~~~
      |            ixFull
a.cc: At global scope:
a.cc:31:6: error: no declaration matches 'void Stack::top()'
   31 | void Stack::top()
      |      ^~~~~
a.cc:21:13: note: candidate is: 'int Stack::top()'
   21 |         int top();
      |             ^~~
a.cc:6:7: note: 'class Stack' defined here
    6 | class Stack{
      |       ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stack>
using namespace std;
const int INF = 0x3f3f3f3f;

int main()
{
	char str[255];
	stack<int> s;
	gets(str);
	int ans = 0;
	for(int i = 0; i < strlen(str); i += 2)
	{
		if(str[i] == '+')
		{
			int temp1 = s.top();
			s.pop();
			int temp = temp1 + s.top();
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else if(str[i] == '-')
		{
			int temp1 = s.top();
			s.pop();
			int temp = s.top() - temp1;
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else if(str[i] == '*') 
		{
			int temp1 = s.top();
			s.pop();
			int temp = temp1 * s.top();
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else
			s.push(str[i] - '0');
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |         gets(str);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stack>
using namespace std;
const int INF = 0x3f3f3f3f;

int main()
{
	char str[255];
	stack<int> s;
	gets(str);
	int ans = 0;
	for(unsigned int i = 0; i < strlen(str); i += 2)
	{
		if(str[i] == '+')
		{
			int temp1 = s.top();
			s.pop();
			int temp = temp1 + s.top();
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else if(str[i] == '-')
		{
			int temp1 = s.top();
			s.pop();
			int temp = s.top() - temp1;
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else if(str[i] == '*') 
		{
			int temp1 = s.top();
			s.pop();
			int temp = temp1 * s.top();
			ans += temp;
			s.pop();
			s.push(temp);
		}
		else
			s.push(str[i] - '0');
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |         gets(str);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
#include<cstdlib>
#include<stack>
using namespace std;
int trace(stack<int> S){
    for(int i=0;i<S.size();i++){
	cout << S.top() << endl;
	S.pop();
    }
}

int main(){
    int a,b;
    string s;
    stack<int> S;

    while(cin >> s){
	if(s[0]=='+'){
	    a=S.top(); S.pop();
	    b=S.top#include<iostream>
#include<cstdlib>
#include<stack>
using namespace std;
int trace(stack<int> S){
    for(int i=0;i<S.size();i++){
	cout << S.top() << endl;
	S.pop();
    }
}

Compiler output:
a.cc:20:20: error: stray '#' in program
   20 |             b=S.top#include<iostream>
      |                    ^
a.cc: In function 'int trace(std::stack<int>)':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
a.cc: In function 'int main()':
a.cc:20:17: error: cannot resolve overloaded function 'top' based on conversion to type 'int'
   20 |             b=S.top#include<iostream>
      |                 ^~~
a.cc:24:24: error: a function-definition is not allowed here before '{' token
   24 | int trace(stack<int> S){
      |                        ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:18:22: note: to match this '{'
   18 |         if(s[0]=='+'){
      |                      ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:17:20: note: to match this '{'
   17 |     while(cin >> s){
      |                    ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^
Language: C++

#include <cstdint>
#include <string>

#include "problems.hpp"

using namespace std;

#define ARRAY_SIZE 256
int32_t array[ARRAY_SIZE];
int32_t index = 0;

void stack_push(int32_t data)
{
  array[index] = data;
  index++;
}

bool stack_pop(int32_t &data)
{
  if (index > 0) {
    index--;
    data = array[index];
    return true;
  }

  return false;
}

#if !defined(TEST)
#include <cstdio>
#include <iostream>

int32_t main()
{
  string str;

  while (cin >> str) {
    if (cin.eof()) break;
    int32_t data1, data2;
    switch (str.front()) {
    case '+':
      stack_pop(data2);
      stack_pop(data1);
      stack_push(data1 + data2);
      break;
    case '-':
      stack_pop(data2);
      stack_pop(data1);
      stack_push(data1 - data2);
      break;
    case '*':
      stack_pop(data2);
      stack_pop(data1);
      stack_push(data1 * data2);
      break;
    default:
      stack_push(stoi(str));
      break;
    }
    str.clear();
  }

  int32_t data;
  stack_pop(data);
  cout << data << endl;

  return 0;
}
#endif

Compiler output:
a.cc:4:10: fatal error: problems.hpp: No such file or directory
    4 | #include "problems.hpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int top, S[1000];

int pop(){
  top--;
  return S[top+1];
}

void push(int x){
  S[++top] = x;
}

int main(){
  int a, b;
  top = 0;
  char s[100];

while (cin >> s) {
  // while (scanf("%s", s) != EOF) {
    if (s[0] == '+'){
      a = pop();
      b = pop();
      push(a+b);
    }else if (s[0] == '-'){
      a = pop();
      b = pop();
      push(a-b);
    }else if (s[0] == '*'){
      a = pop();
      b = pop();
      push(a*b);
    }else {
      push(atoi(s.c_str()));
    }
  }

  cout << pop() << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: request for member 'c_str' in 's', which is of non-class type 'char [100]'
   37 |       push(atoi(s.c_str()));
      |                   ^~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <utility>
using namespace std;

int main(void)
{	
	Operand operand;
	
	char buf[200][8] = {"\0"};
	for (int i = 0; cin >> buf[i]; i++);
	
	int result;
	for (int i = 0; buf[i][0] != '\0'; i++) {
		if (buf[i][0] >= '0' && buf[i][0] <= '9') {
			operand.add(atoi(buf[i]));
		} else {
			result = operand.calc(buf[i][0]);
		}
	}
	
	cout << result << endl;
	
	return 0;
}

class Operand {
private:
	int stack[100] = {0};
	int state = 0;
public:
	void add(int x);
	int calc(char symbol);
}

void Operand::add(int x)
{
	stack[state] = x;
	state++;
}

int Operand::calc(char symbol)
{
	if (symbol == '+') {
		stack[state-2] = stack[state-2] + stack[state-1];
	} else if (symbol == '-') {
		stack[state-2] = stack[state-2] - stack[state-1];
	} else if (symbol == '*') {
		stack[state-2] = stack[state-2] * stack[state-1];
	} else {
	}
	state--;
	
	return stack[state-1];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'Operand' was not declared in this scope; did you mean 'srand'?
    8 |         Operand operand;
      |         ^~~~~~~
      |         srand
a.cc:16:25: error: 'operand' was not declared in this scope; did you mean 'srand'?
   16 |                         operand.add(atoi(buf[i]));
      |                         ^~~~~~~
      |                         srand
a.cc:18:34: error: 'operand' was not declared in this scope; did you mean 'srand'?
   18 |                         result = operand.calc(buf[i][0]);
      |                                  ^~~~~~~
      |                                  srand
a.cc: At global scope:
a.cc:34:2: error: expected ';' after class definition
   34 | }
      |  ^
      |  ;
Language: C++

#include <stdio.h>
#include <iostream>
#include <utility>
using namespace std;

class Operand {
private:
	int stack[100] = {0};
	int state = 0;
public:
	void add(int x);
	int calc(char symbol);
}

void Operand::add(int x)
{
	stack[state] = x;
	state++;
}

int Operand::calc(char symbol)
{
	if (symbol == '+') {
		stack[state-2] = stack[state-2] + stack[state-1];
	} else if (symbol == '-') {
		stack[state-2] = stack[state-2] - stack[state-1];
	} else if (symbol == '*') {
		stack[state-2] = stack[state-2] * stack[state-1];
	} else {
	}
	state--;
	
	return stack[state-1];
}

int main(void)
{	
	Operand operand;
	
	char buf[200][8] = {"\0"};
	for (int i = 0; cin >> buf[i]; i++);
	
	int result;
	for (int i = 0; buf[i][0] != '\0'; i++) {
		if (buf[i][0] >= '0' && buf[i][0] <= '9') {
			operand.add(atoi(buf[i]));
		} else {
			result = operand.calc(buf[i][0]);
		}
	}
	
	cout << result << endl;
	
	return 0;
}

Compiler output:
a.cc:13:2: error: expected ';' after class definition
   13 | }
      |  ^
      |  ;
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 ss;
    while(cin>>ss){
        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:52:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   52 |         if (s[0] == '+'){
      |              ^
a.cc:57:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   57 |         else if (s[0] == '-'){
      |                   ^
a.cc:62:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   62 |         else if (s[0] == '*'){
      |                   ^
a.cc:68:27: error: 'class std::stack<int>' has no member named 'c_str'
   68 |             s.push(atoi(s.c_str());
      |                           ^~~~~
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;
 


int main(){
    stack<int> s;
    int a,b,x;
    string ss;
    while(cin>>ss){
        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:28:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   28 |         if (s[0] == '+'){
      |              ^
a.cc:33:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   33 |         else if (s[0] == '-'){
      |                   ^
a.cc:38:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   38 |         else if (s[0] == '*'){
      |                   ^
a.cc:44:27: error: 'class std::stack<int>' has no member named 'c_str'
   44 |             s.push(atoi(s.c_str());
      |                           ^~~~~
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;
 


int main(){
    stack<int> s;
    int a,b,x;
    string ss;
    while(cin>>ss){
        if (ss[0] == '+'){
            a = s.top();s.pop();
            b = s.top();s.pop();
            s.push(a+b);
        }
        else if (ss[0] == '-'){
            a = s.top();s.pop();
            b = s.top();s.pop();
            s.push(a-b);
        }
        else if (ss[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:44:27: error: 'class std::stack<int>' has no member named 'c_str'
   44 |             s.push(atoi(s.c_str());
      |                           ^~~~~
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;
 


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

Compiler output:
a.cc: In function 'int main()':
a.cc:44:36: error: expected ')' before ';' token
   44 |             s.push(atoi(ss.c_str());
      |                   ~                ^
      |                                    )
Language: C++

#include <stdio.h>

#define N 200
#define Max 1000000

int top;
int S[N];

int pop(){
	return S[top--];
}

void init(){
	top = 0;
}

void push(int x){
	S[++top] = x;
}
int main(){
	char s[Max];
	int a,b;
	init();
	while(scanf("%s",s)!=EOF){
		if(!strcmp(s,"+")){
			a = pop();
			b = pop();
			push(a+b);
		}
		else if(!strcmp(s,"-")){
			a = pop();
			b = pop();
			push(b - a);
		}
		else if(!strcmp(s,"*")){
			a = pop();
			b = pop();
			push(a * b);
		}
		else{
			push(atoi(s));
		}
	}
	printf("%d\n",pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'strcmp' was not declared in this scope
   25 |                 if(!strcmp(s,"+")){
      |                     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:41:30: error: 'atoi' was not declared in this scope
   41 |                         push(atoi(s));
      |                              ^~~~
Language: C++

#include<math.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

char character;
int stack[110];
int num = 0;

int main() {
    while (scanf("%c", character) != EOF) {
        if(character == '+') {
            stack[num-1] += stack[num];
            num--;
        }
        else if(character == '-') {
            stack[num-1] -= stack[num];
            num--;
        }
        else if (character == '*') {
            stack[num-1] = stack[num-1] * stack[num];
            num--;
        }
        else {
            stack[num+1] = atoi(character);
            num++;
        }
    }
    printf("%d\n", stack[0]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   25 |             stack[num+1] = atoi(character);
      |                                 ^~~~~~~~~
      |                                 |
      |                                 char
In file included from /usr/include/c++/14/bits/std_abs.h:38,
                 from /usr/include/c++/14/cmath:49,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<math.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

char character[10];
int stack[110];
int num = 0;

int main() {
    while (scanf("%s", character) != EOF) {
        if(character == '+') {
            stack[num-1] += stack[num];
            num--;
        }
        else if(character == '-') {
            stack[num-1] -= stack[num];
            num--;
        }
        else if (character == '*') {
            stack[num-1] = stack[num-1] * stack[num];
            num--;
        }
        else {
            stack[num+1] = atoi(character);
            num++;
        }
    }
    printf("%d\n", stack[0]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if(character == '+') {
      |            ~~~~~~~~~~^~~~~~
a.cc:16:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         else if(character == '-') {
      |                 ~~~~~~~~~~^~~~~~
a.cc:20:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         else if (character == '*') {
      |                  ~~~~~~~~~~^~~~~~
Language: C++

class Stack:
    def __init__(self):
        self.values = []
        self.n = 0

    def pop(self):
        if self.n == 0:
            raise Exception("stack underflow")
        else:
            v = self.values[-1]
            del self.values[-1]
            self.n -= 1
            return v

    def push(self,x):
        self.values.append(x)
        self.n += 1


operators = set(['+', '-', '*'])
stack = Stack()

for op in raw_input().split(' '):
    if op in operators:
        b = stack.pop()
        a = stack.pop()
        if op == '+':
            stack.push(a+b)
        elif op == '-':
            stack.push(a-b)
        elif op == '*':
            stack.push(a*b)
        else:
            raise Exception("Unkown operator")
    else:
        stack.push(int(op))

print stack.pop()

Compiler output:
a.cc:2:9: error: expected class-name before '__init__'
    2 |     def __init__(self):
      |         ^~~~~~~~
a.cc:2:9: error: expected '{' before '__init__'
a.cc:2:18: error: 'self' was not declared in this scope
    2 |     def __init__(self):
      |                  ^~~~
Language: C++

#include <iostream>
#include <string>
#include <stack>
#include <cstdlib>

using namespace std;

int main() {
    string s;
    stack<int> St;

    while(cin >> s) {
        if (s == "+") {
            int n = St.top();
            St.pop();
            n += St.top();
            St.pop();
            St.push(n);
        }
        else if (s == "-") {
            int n = -St.top();
            St.pop();
            n += St.top();
            St.pop();
            St.push(n);
        }
        else if (s == "*") {
            int n = St.top();
            St.pop();
            n *= St.top();
            St.pop();
            St.push(n);
        }
        else {
            St.push(atoi(word.c_str()));
        }
    }
    cout << St.top() << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: error: 'word' was not declared in this scope
   35 |             St.push(atoi(word.c_str()));
      |                          ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

int main()
{
	stack<int> s;
	char b[315];
	scanf("%[^\n]", b);

	for(int I=0;I<strlen(b);I++){
		if (b[I] == '+'||b[I]=='-'||b[I]=='*') {
			int j = s.top(); s.pop();
			int i = s.top(); s.pop();
			int k;
			if (b[I] == '+')k = i + j;
			if (b[I] == '-')k = i - j;
			if (b[I] == '*')k = i * j;

			s.push(k);
		}
		else if(b[I]!=' '){
			int i = b[I] - '0';
			s.push(i);
		}
	}
	int ans = s.top(); s.pop();
	printf("%d\n", ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: 'strlen' was not declared in this scope
   23 |         for(int I=0;I<strlen(b);I++){
      |                       ^~~~~~
a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include<math.h>
  +++ |+#include <cstring>
   12 | #define INF 999999
Language: C++

#include <iostream>
#include <string>
#include <stack>
#include <cstdlib>
 
using namespace std;
 
int main()
{
    int a, b;
    string s;
    stack<int> St;
 
    while(cin >> s) {
        if (s == "+") {
            b = St.top(); St.pop();
            a = St.top(); St.pop()
            St.push(a+b);
        }
        else if (s == "-") {
            b = St.top(); St.pop();
            a = St.top(); St.pop()
            St.push(a-b);
        }
        else if (s == "*") {
            b = St.top(); St.pop();
            a = St.top(); St.pop()
            St.push(a*b);
        }
        else {
            St.push(atoi(s.c_str()));
        }
    }
    cout << St.top() << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: expected ';' before 'St'
   17 |             a = St.top(); St.pop()
      |                                   ^
      |                                   ;
   18 |             St.push(a+b);
      |             ~~                     
a.cc:22:35: error: expected ';' before 'St'
   22 |             a = St.top(); St.pop()
      |                                   ^
      |                                   ;
   23 |             St.push(a-b);
      |             ~~                     
a.cc:27:35: error: expected ';' before 'St'
   27 |             a = St.top(); St.pop()
      |                                   ^
      |                                   ;
   28 |             St.push(a*b);
      |             ~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#define SIZE 200
class stack {
public:
	void init();
	void push(char ch);
	char pop();
	
private:
	char a[SIZE] = {0};
	int tos;
};
void stack::init() {
	tos = 0;
}
void stack::push(char ch) {
	a[tos] = ch;
	tos++;
}
char stack::pop() {
	tos--;
	return a[tos];
}





using namespace std;
int main() {
	
	/*string str;*/
	stack s;
	char ed='0',d[200];
	int b, c,j=0;
	s.init();
	while (ed != EOF) {
		cin >> ed;
		if (ed == \n) {
			break;
		}
		d[j] = ed;
		j++;
		
	}
	for (int i = 0; i < j; i+=1) {
		if (d[i] == '+') {
			b = s.pop();
			cout << "pop1" << b << endl;
			c = s.pop();
			cout << "pop2" << c << endl;
			s.push(b + c);
			cout << "+"<<b + c << endl;
		}
		else if (d[i] == '-') {
			b = s.pop();
			c = s.pop();
			s.push(b - c);
		}
		else if (d[i] == '*') {
			b = s.pop();
			c = s.pop();
			s.push(b*c);
		}
		else {
			s.push(d[i]);
			cout << d[i] << endl;
		}
	}
	cout << s.pop() << endl;
	return 0;

}

Compiler output:
a.cc:41:27: error: stray '\' in program
   41 |                 if (ed == \n) {
      |                           ^
a.cc: In function 'int main()':
a.cc:41:28: error: 'n' was not declared in this scope
   41 |                 if (ed == \n) {
      |                            ^