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

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

stack<int >S;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'top' was not declared in this scope
   13 |                         a = top();pop();
      |                             ^~~
a.cc:13:35: error: 'pop' was not declared in this scope; did you mean 'popen'?
   13 |                         a = top();pop();
      |                                   ^~~
      |                                   popen
a.cc:18:29: error: 'top' was not declared in this scope
   18 |                         b = top();pop();
      |                             ^~~
a.cc:18:35: error: 'pop' was not declared in this scope; did you mean 'popen'?
   18 |                         b = top();pop();
      |                                   ^~~
      |                                   popen
a.cc:23:29: error: 'top' was not declared in this scope
   23 |                         a = top();pop();
      |                             ^~~
a.cc:23:35: error: 'pop' was not declared in this scope; did you mean 'popen'?
   23 |                         a = top();pop();
      |                                   ^~~
      |                                   popen
Language: C++

#include<cstring>
#include<stdlib.h>
using namespace std;
int top,s[1000];

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

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

int main(){
int a,b;
top=0;
char s[100];
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));}
}
printf("%d\n",pop());
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'scanf' was not declared in this scope
   19 | while(scanf("%s",s)!=EOF){
      |       ^~~~~
a.cc:19:22: error: 'EOF' was not declared in this scope
   19 | while(scanf("%s",s)!=EOF){
      |                      ^~~
a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<stdlib.h>
  +++ |+#include <cstdio>
    3 | using namespace std;
a.cc:37:1: error: 'printf' was not declared in this scope
   37 | printf("%d\n",pop());
      | ^~~~~~
a.cc:37:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<string.h>
#include<stdlib.h>
using namespace std;
int top,s[1000];

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

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

int main(){
int a,b;
top=0;
char s[100];
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
    a=pop();
    b=pop();
    push(a+b);
}
else if(s[0]=='-'){
    b=pop();
    a=pop();
    push(a-b);
}
else if(s[0]=='*'){
    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:19:7: error: 'scanf' was not declared in this scope
   19 | while(scanf("%s",s)!=EOF){
      |       ^~~~~
a.cc:19:22: error: 'EOF' was not declared in this scope
   19 | while(scanf("%s",s)!=EOF){
      |                      ^~~
a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<stdlib.h>
  +++ |+#include <cstdio>
    3 | using namespace std;
a.cc:37:1: error: 'printf' was not declared in this scope
   37 | printf("%d\n",pop());
      | ^~~~~~
a.cc:37:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdafx.h>
#include<iostream>
#include<string>
using namespace std;

int top, S[1000];

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

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

int main()
{
	int a, b;
	top = 0;
	string s;
	getline(cin, s);
	for (int i = 0; i < sizeof(s); i++) {
		if (s[i] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s[i] == '-') {
			b = pop();
			a = pop();
			push(b - a);
		}
		else if (s[i] == '*') {
			a = pop();
			b = pop();
			push(a*b);
		}
		else {
			push((int)s[i]);
		}
	}
	cout << pop() << endl;
    return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include<stdafx.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

using namespace std;
string s;
int  top,S[1000];

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

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

int main()
{
	int a, b;
	top = 0;
	while(cin>>s){
		if (s[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s[0] == '-') {
			b = pop();
			a = 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:2:1: error: 'string' does not name a type
    2 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:18:15: error: 'cin' was not declared in this scope
   18 |         while(cin>>s){
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:18:20: error: 's' was not declared in this scope
   18 |         while(cin>>s){
      |                    ^
a.cc:35:30: error: 'atoi' was not declared in this scope
   35 |                         push(atoi(s.c_str()));
      |                              ^~~~
a.cc:38:9: error: 'cout' was not declared in this scope
   38 |         cout << pop() << endl;
      |         ^~~~
a.cc:38:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:38:26: error: 'endl' was not declared in this scope
   38 |         cout << pop() << endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include<iostream>
#include<stack>
#include<string>
#include <cstdlib>
int main(){
	std::stack<int> s;
	std::string b;
	int bu;
	while(std::cin>>b;){
		if(b=="+"){
			bu=s.top();
			s.pop();
			s.top()+=bu;
		}
		else if(b=="-"){
			bu=s.top();
			s.pop();
			s.top()=s.top()-bu;
		}
		else if(b=="*"){
		    bu=s.top();
			s.pop();
			s.top()*=bu;	
		}
		else{
			s.push(std::atoi( b.c_str() ));
		}
	}
	std::cout<<s.top()<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ')' before ';' token
    9 |         while(std::cin>>b;){
      |              ~           ^
      |                          )
a.cc:9:27: error: expected primary-expression before ')' token
    9 |         while(std::cin>>b;){
      |                           ^
Language: C++

#include <cstdio>
#include <cctype>
#include <cstdlib>
using namespace std;

const int MAX = 100;
int top, s[MAX + 1];

void initialize() {
  top = 0;
}

bool isEmpty() {
  return top == 0;
}

bool isFull() {
  return top >= MAX;
}

void push(int x) {
  if (isFull()) {
    fprintf(stderr, "error: stack is full\n");
    exit(1);
  }
  top++;
  s[top] = x;
}

int pop() {
  if (isEmpty()) {
    fprintf(stderr, "error: stack is empty\n");
    exit(1);
  }
  top--;
  return s[top + 1];
}

int main() {
  initialize();
  string str;
  while (scanf("%s", str) != EOF) {
    if (isdigit(str[0])) {
      push(atoi(str));
    } else {
      int a = pop();
      int b = pop();
      switch (str) {
        case "+":
          push(a + b);
        case "-":
          push(a - b);
        case "*":
          push(a * b);
      }
    } 
  }
  printf("%d", pop());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: 'string' was not declared in this scope
   41 |   string str;
      |   ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include <cstdlib>
  +++ |+#include <string>
    4 | using namespace std;
a.cc:42:22: error: 'str' was not declared in this scope; did you mean 'std'?
   42 |   while (scanf("%s", str) != EOF) {
      |                      ^~~
      |                      std
Language: C++

#include<iostream>
#include<stdio.h>
#include<stack>
#include<string>
#include<cstdlib>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected unqualified-id before ';' token
   10 |         int a,b,;
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int data[MAX + 1];
int head = 0;

void push(int num) {
  data[head] = num;
  head++;
}

int pop() {
  head--;
  return data[head];
}

int main() {
  int a, b;
  char ch[100];
  while (cin >> ch) {
    switch (ch[0]) {
    case '+':
      a = pop();
      b = pop();
      push(b + a);
      break;
    case '-':
      a = pop();
      b = pop();
      push(b - a);
      break;
    case '*':
      a = pop();
      b = pop();
      push(b * a);
      break;
    default:
      push(atoi(ch));
      break;
    }
  }
  cout << data[0] << endl;
}

Compiler output:
a.cc:4:10: error: 'MAX' was not declared in this scope
    4 | int data[MAX + 1];
      |          ^~~
a.cc: In function 'void push(int)':
a.cc:8:7: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |   data[head] = num;
      |       ^
a.cc: In function 'int pop()':
a.cc:14:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |   return data[head];
      |              ^
a.cc: In function 'int main()':
a.cc:42:15: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   42 |   cout << data[0] << endl;
      |               ^
Language: C++

#include <stdlib.h>
#include <iostream>
#include <stack>
using namespace std;

int main() {
	stack<int> S;
	char ch;
	int a, b;

	while (cin >> ch)
	{
	    switch(ch)
	    {
	        case '+':
	            a = S.top();
	            b = S.top();
	            S.pop();
	            S.pop();
	            S.push(a+b);
	            break;
	        case '-':
	            a = S.top();
	            b = S.top();
	            S.pop();
	            S.pop();
	            S.push(a-b);
	            break;
	        case '*':
	            a = S.top();
	            b = S.top();
	            S.pop();
	            S.pop();
	            S.push(a*b);
	            break;
	        default:
	            S.push(atoi(ch))
	    }
	}
	
	cout << S.top() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   37 |                     S.push(atoi(ch))
      |                                 ^~
      |                                 |
      |                                 char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.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)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:37:37: error: expected ';' before '}' token
   37 |                     S.push(atoi(ch))
      |                                     ^
      |                                     ;
   38 |             }
      |             ~
Language: C++

#include <stdlib.h>
#include <iostream>
#include <stack>
#include <string>
using namespace std;

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

	while (cin >> ch)
	{
	    switch(ch)
	    {
	        case '+':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a+b);
	            break;
	        case '-':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a-b);
	            break;
	        case '*':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a*b);
	            break;
	        default:
	            S.push(atoi(ch));
	    }
	}
	
	cout << S.top() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: switch quantity not an integer
   14 |             switch(ch)
      |                    ^~
a.cc:38:33: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   38 |                     S.push(atoi(ch));
      |                                 ^~
      |                                 |
      |                                 std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.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 <stdlib.h>
#include <iostream>
#include <stack>
#include <string>
using namespace std;

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

	while (cin >> ch)
	{
	    switch(ch[0])
	    {
	        case '+':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a+b);
	            break;
	        case '-':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a-b);
	            break;
	        case '*':
	            a = S.top();
	            S.pop();
	            b = S.top();
	            S.pop();
	            S.push(a*b);
	            break;
	        default:
	            S.push(atoi(ch));
	    }
	}
	
	cout << S.top() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:33: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   38 |                     S.push(atoi(ch));
      |                                 ^~
      |                                 |
      |                                 std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.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 <iostream>
#include <string>

using namespace std;

const int max_size = 101;
int que[max_size];
int top = 0;

bool isFull()
{
	return top == max_size;
}

bool isEmpty()
{
	return top == 0;
}

void push(int key)
{
	if (isFull())
		cout << "Stack is Full" << endl;
	que[top++] = key;
}

int pop()
{
	if (isEmpty())
		cout << "Stack is EMPTY" << endl;
	return (que[--top]);
}
int main(int argc, char** argv)
{
	string s;
	while (cin >> s) {
		if (s == "+") {
			int a, b;
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == "-") {
			int a, b;
			a = pop();
			b = pop();
			push(b - a);
		}
		else if (s == "*") {
			int a, b;
			a = pop();
			b = pop();
			push(b * a);
		}
		else
			push(string::stoi(s));
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:56:38: error: 'stoi' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   56 |                         push(string::stoi(s));
      |                                      ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

const int max_size = 101;
int que[max_size];
int top = 0;

bool isFull()
{
	return top == max_size;
}

bool isEmpty()
{
	return top == 0;
}

void push(int key)
{
	if (isFull())
		cout << "Stack is Full" << endl;
	que[top++] = key;
}

int pop()
{
	if (isEmpty())
		cout << "Stack is EMPTY" << endl;
	return (que[--top]);
}
int main(int argc, char** argv)
{
	string s;
	while (cin >> s) {
		if (s == "+") {
			int a, b;
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == "-") {
			int a, b;
			a = pop();
			b = pop();
			push(b - a);
		}
		else if (s == "*") {
			int a, b;
			a = pop();
			b = pop();
			push(b * a);
		}
		else
			push(atoi(s.cstr()));
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:56:37: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'cstr'; did you mean 'c_str'?
   56 |                         push(atoi(s.cstr()));
      |                                     ^~~~
      |                                     c_str
Language: C++

#include <iostream>
#include <string>
#include <stdlib>

using namespace std;

const int max_size = 101;
int que[max_size];
int top = 0;

bool isFull()
{
	return top == max_size;
}

bool isEmpty()
{
	return top == 0;
}

void push(int key)
{
	if (isFull())
		cout << "Stack is Full" << endl;
	que[top++] = key;
}

int pop()
{
	if (isEmpty())
		cout << "Stack is EMPTY" << endl;
	return (que[--top]);
}
int main(int argc, char** argv)
{
	string s;
	while (cin >> s) {
		if (s == "+") {
			int a, b;
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == "-") {
			int a, b;
			a = pop();
			b = pop();
			push(b - a);
		}
		else if (s == "*") {
			int a, b;
			a = pop();
			b = pop();
			push(b * a);
		}
		else
			push(atoi(s.cstr()));
	}

	return 0;
}

Compiler output:
a.cc:3:10: fatal error: stdlib: No such file or directory
    3 | #include <stdlib>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

const int max_size = 101;
int que[max_size];
int top = 0;

bool isFull()
{
	return top == max_size;
}

bool isEmpty()
{
	return top == 0;
}

void push(int key)
{
	if (isFull())
		cout << "Stack is Full" << endl;
	que[top++] = key;
}

int pop()
{
	if (isEmpty())
		cout << "Stack is EMPTY" << endl;
	return (que[--top]);
}
int main(int argc, char** argv)
{
	string s;
	while (cin >> s) {
		if (s == "+") {
			int a, b;
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == "-") {
			int a, b;
			a = pop();
			b = pop();
			push(b - a);
		}
		else if (s == "*") {
			int a, b;
			a = pop();
			b = pop();
			push(b * a);
		}
		else
			push(atoi(s.cstr()));
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:57:37: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'cstr'; did you mean 'c_str'?
   57 |                         push(atoi(s.cstr()));
      |                                     ^~~~
      |                                     c_str
Language: C++

#include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x+y); } else if(a.str[0]=='*'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x*y); } else if(a.str[0]=='-'){ y=st.top(); st.pop(); x=st.top(); st.pop(); st.push(x-y); } else if(a.str[0]=='/'){ y=st.top(); st.pop(); x=st.top(); st.pop(); st.push(x/y); } else st.push(atoi(a.str)); } int ans=st.top(); printf("%d\n",ans); return 0; }

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x+y); } else if(a.str[0]=='*'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x*y); } else if(a.str[0]=='-'){ y=st.top(); st.pop(); x=st.top(); st.pop(); st.push(x-y); } else if(a.str[0]=='/'){ y=st.top(); st.pop(); x=st.top(); st.pop(); st.push(x/y); } else st.push(atoi(a.str)); } int ans=st.top(); printf("%d\n",ans); return 0; }
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namesapce std;

int S[1000],top;

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

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

int main(){
	int a, b;
	top = 0;
	char s[100];
	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));
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namesapce'
    4 | using namesapce std;
      |       ^~~~~~~~~
Language: C++

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

int S[1000],top;

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

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

int main(){
	int a, b;
	top = 0;
	char s[100];
	while (cin >> s){
		if (s == '+'){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == '-'){
			a = pop();
			b = pop();
			push(a - b);
		}
		else if (s == '*'){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(atoi(s.c_str()));
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (s == '+'){
      |                     ~~^~~~~~
a.cc:27:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 else if (s == '-'){
      |                          ~~^~~~~~
a.cc:32:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |                 else if (s == '*'){
      |                          ~~^~~~~~
a.cc:38:37: error: request for member 'c_str' in 's', which is of non-class type 'char [100]'
   38 |                         push(atoi(s.c_str()));
      |                                     ^~~~~
Language: C++

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

int S[1000],top;

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

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

int main(){
	stack<int> s;
	int a, b;
	top = 0;
	while (cin >> s){
		if (s == '+'){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s == '-'){
			a = pop();
			b = pop();
			push(a - b);
		}
		else if (s == '*'){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(atoi(s.c_str()));
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'stack' was not declared in this scope
   19 |         stack<int> s;
      |         ^~~~~
a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    4 | #include<cstdlib>
  +++ |+#include <stack>
    5 | using namespace std;
a.cc:19:15: error: expected primary-expression before 'int'
   19 |         stack<int> s;
      |               ^~~
a.cc:22:23: error: 's' was not declared in this scope
   22 |         while (cin >> s){
      |                       ^
Language: C++

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

int S[1000],top;

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

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

int main(){
	stack<int> s;
	string st;
	int a, b;
	top = 0;
	while (cin >> st){
		if (st == "+"){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (st == "-"){
			a = pop();
			b = pop();
			push(a - b);
		}
		else if (st == "*"){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(atoi(st.c_str()));
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'stack' was not declared in this scope
   19 |         stack<int> s;
      |         ^~~~~
a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    4 | #include<cstdlib>
  +++ |+#include <stack>
    5 | using namespace std;
a.cc:19:15: error: expected primary-expression before 'int'
   19 |         stack<int> s;
      |               ^~~
Language: C++

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

int S[1000],top;

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

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

int main(){
	stack<int> s;
	string st;
	int a, b;
	top = 0;
	while (cin >> st){
		if (st == "+"){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (st == "-"){
			a = pop();
			b = pop();
			push(a - b);
		}
		else if (st == "*"){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			long tmp = atoi(st.c_str());
			push(tmp);
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'stack' was not declared in this scope
   19 |         stack<int> s;
      |         ^~~~~
a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    4 | #include<cstdlib>
  +++ |+#include <stack>
    5 | using namespace std;
a.cc:19:15: error: expected primary-expression before 'int'
   19 |         stack<int> s;
      |               ^~~
Language: C++

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

int S[1000],top;

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

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

int main(){
	char s[100]
	int a, b;
	top = 0;
	while (scanf("%d",s){
		if (s[0] == "+"){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s[0] == "-"){
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (s[0] == "*"){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(s);
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected initializer before 'int'
   19 |         int a, b;
      |         ^~~
a.cc:21:27: error: 's' was not declared in this scope
   21 |         while (scanf("%d",s){
      |                           ^
a.cc:21:29: error: expected ')' before '{' token
   21 |         while (scanf("%d",s){
      |               ~             ^
      |                             )
a.cc:23:25: error: 'a' was not declared in this scope
   23 |                         a = pop();
      |                         ^
a.cc:24:25: error: 'b' was not declared in this scope
   24 |                         b = pop();
      |                         ^
a.cc:28:25: error: 'b' was not declared in this scope
   28 |                         b = pop();
      |                         ^
a.cc:29:25: error: 'a' was not declared in this scope
   29 |                         a = pop();
      |                         ^
a.cc:33:25: error: 'a' was not declared in this scope
   33 |                         a = pop();
      |                         ^
a.cc:34:25: error: 'b' was not declared in this scope
   34 |                         b = pop();
      |                         ^
Language: C++

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

int S[1000],top;

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

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

int main(){
	char s[100];
	int a, b;
	top = 0;
	while (scanf("%d",s){
		if (s[0] == "+"){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s[0] == "-"){
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (s[0] == "*"){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(s);
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: expected ')' before '{' token
   21 |         while (scanf("%d",s){
      |               ~             ^
      |                             )
a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (s[0] == "+"){
      |                     ~~~~~^~~~~~
a.cc:27:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 else if (s[0] == "-"){
      |                          ~~~~~^~~~~~
a.cc:32:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |                 else if (s[0] == "*"){
      |                          ~~~~~^~~~~~
a.cc:38:30: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   38 |                         push(s);
      |                              ^
      |                              |
      |                              char*
a.cc:8:15: note:   initializing argument 1 of 'void push(int)'
    8 | void push(int x){
      |           ~~~~^
Language: C++

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

int S[1000],top;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (s[0] == "+"){
      |                     ~~~~~^~~~~~
a.cc:27:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 else if (s[0] == "-"){
      |                          ~~~~~^~~~~~
a.cc:32:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |                 else if (s[0] == "*"){
      |                          ~~~~~^~~~~~
a.cc:38:30: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   38 |                         push(s);
      |                              ^
      |                              |
      |                              char*
a.cc:8:15: note:   initializing argument 1 of 'void push(int)'
    8 | void push(int x){
      |           ~~~~^
Language: C++

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

int S[1000],top;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (s[0] == "+"){
      |                     ~~~~~^~~~~~
a.cc:27:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 else if (s[0] == "-"){
      |                          ~~~~~^~~~~~
a.cc:32:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |                 else if (s[0] == "*"){
      |                          ~~~~~^~~~~~
a.cc:38:30: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   38 |                         push(s);
      |                              ^
      |                              |
      |                              char*
a.cc:8:15: note:   initializing argument 1 of 'void push(int)'
    8 | void push(int x){
      |           ~~~~^
Language: C++

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

int S[1000],top;

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

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

int main(){
	char s[100];
	int a, b;
	top = 0;
	while (scanf("%s",s)!=EOF){
		if (s[0] == '+'){
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (s[0] == '-'){
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (s[0] == '*'){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(s);
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:30: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   38 |                         push(s);
      |                              ^
      |                              |
      |                              char*
a.cc:8:15: note:   initializing argument 1 of 'void push(int)'
    8 | void push(int x){
      |           ~~~~^
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int S[1000], top;

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

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

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

Compiler output:
a.cc: In function 'void pop()':
a.cc:13:25: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |         return S[top + 1];
      |                ~~~~~~~~~^
a.cc: In function 'int main()':
a.cc:22:32: error: void value not ignored as it ought to be
   22 |                         a = pop();
      |                             ~~~^~
a.cc:23:32: error: void value not ignored as it ought to be
   23 |                         b = pop();
      |                             ~~~^~
a.cc:26:32: error: void value not ignored as it ought to be
   26 |                         b = pop();
      |                             ~~~^~
a.cc:27:32: error: void value not ignored as it ought to be
   27 |                         a = pop();
      |                             ~~~^~
a.cc:30:32: error: void value not ignored as it ought to be
   30 |                         b = pop();
      |                             ~~~^~
a.cc:31:32: error: void value not ignored as it ought to be
   31 |                         a = pop();
      |                             ~~~^~
a.cc:38:27: error: invalid use of void expression
   38 |         printf("%d\n", pop());
      |                        ~~~^~
Language: C++

#include<string>
#include<cctype>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define inf 0x3f3f3f3f
typedef long long ll;
const int maxn = 1000 + 8;
int sta[maxn];
char c[100];
int top ;
/*
bool isEmpty(int sta[])
{
    return !top;
}*/

int pop()
{
    top--;
    return sta[top+1];
    /*int x = sta[top];
    top--;
    return x;*/
}
void push(int x)
{
    sta[++top] = x;
    return;
}
void add()
{
    int y = pop();
    int x = pop();
    //cout <<"x + y: " << x + y << endl;
    push(x+y);
    //cout << sta[top] << endl;
}
void subtract()
{
    int y =  pop();
    int x =  pop();
    //cout << "x - y: " <<x - y << endl;
    push(x-y);
    //cout << sta[top] << endl;
}

void multiple()
{
    int y = pop();
    int x = pop();
    //cout <<"x * y: "<< x * y << endl;
    push(x*y);
    //cout << sta[top] << endl;
}
void operate(char s[])
{
    int x = atoi(c);
    push(x);
}
int main()
{
    top = 0;
    while(scanf("%s",c) != EOF)
    {
        if(strcmp(c,"+") == 0){
            add();
        }else if(strcmp(c,"-") == 0){
            subtract();
        }else if(strcmp(c,"*") == 0){
            multiple();
        }else {
            operate(c);
        }

        if(strcmp(c,"#") == 0) break;
    }
    printf("%d\n",sta[top]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:12: error: 'strcmp' was not declared in this scope
   69 |         if(strcmp(c,"+") == 0){
      |            ^~~~~~
a.cc:8:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<stack>
  +++ |+#include <cstring>
    8 | using namespace std;
a.cc:79:12: error: 'strcmp' was not declared in this scope
   79 |         if(strcmp(c,"#") == 0) break;
      |            ^~~~~~
a.cc:79:12: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
using namespace std;

int top, S[1000];

class myStack {
public:
	void push(int x) {
		S[++top] = x;
	}
	int pop() {
		top--;
		return S[top + 1];
	}

private:
	int top = 0;
	int S[1000] = { 0 };
};

int main() {
	char s[100];
	myStack sta;

	while (scanf_s("%s", s) != EOF) {
		if (s[0] == '+') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(a + b);
		}
		else 	if (s[0] == '-') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(a - b);
		}
		else 	if (s[0] == '*') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(a * b);
		}
		else {
			sta.push(atoi(s));
		}

		cout << sta.pop();
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   25 |         while (scanf_s("%s", s) != EOF) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include<iostream>
using namespace std;

int top, S[1000];

class myStack {
public:
	void push(int x) {
		S[++top] = x;
	}
	int pop() {
		top--;
		return S[top + 1];
	}

private:
	int top = 0;
	int S[1000] = { 0 };
};

int main() {
	char s[100];
	myStack sta;

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

		cout << sta.pop();
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:34: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   42 |                         sta.push((int)s);
      |                                  ^~~~~~
Language: C++

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

class myStack {
public:
	void push(int x) {
		S[++top] = x;
	}
	int pop() {
		top--;
		return S[top + 1];
	}

private:
	int top = 0;
	int S[1000] = { 0 };
};

int main() {
	string s;
	myStack sta;

	cin >> s;
	while (cin.eof()) {
/*		if (s[0] == '\n' || *s == ' ') {
			continue;
		}
		else*/ if (s[0] == '+') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(b + a);
		//	cout << "???" << endl;
		}
		else 	if (s[0] == '-') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(b - a);
	//		cout << "???" << endl;
		}
		else 	if (s[0] == '*') {
			int a = sta.pop();
			int b = sta.pop();
			sta.push(b * a);
//			cout << "???" << endl;
		}
		else {
			istrstream istr(s.c_str);
			int i;
			istr >> i;
			sta.push(i);
//			cout << "???" << endl;
		}

		cin >> s;
//		cout << "???" << endl;
	}

	cout << sta.pop() << endl;

	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/backward/strstream:50,
                 from a.cc:3:
/usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
   32 | #warning \
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:49:43: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   49 |                         istrstream istr(s.c_str);
      |                                         ~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

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

void push(int);
int pop(void);
int isEmpty(void);
int isFull(void);

int top=0,S[100];

int main(){
  int x,a,b;
  char s[100];
  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 {
      x = atoi(s);
      push(x);
    }
  }
  printf("%d",S[top]);
  return 0;
}

  



void push(int x){
  if(isFull()==1){
    top++;
    S[top]=x;
  }
 
}
int pop(){
  if(isEmpty()==1){
    top--;
    return S[top+1];
  }
 
  
}

int isEmpty(){
  if(top==0){
    return 0;
  }
  else{
    return 1;
  }

}
int isfull(){
  if(top>99){
    return 0;
  }
  else return 1;
}

Compiler output:
a.cc: In function 'int pop()':
a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
/usr/bin/ld: /tmp/ccdpJUli.o: in function `push(int)':
a.cc:(.text+0x10a): undefined reference to `isFull()'
collect2: error: ld returned 1 exit status
Language: C++

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


int main(){

  char symbol[100];
  int  num[99],x=0;

  while(scanf("%s",symbol)!=EOF){
  if(symbol=='+'){
    num[x-2]=num[x-2]+num[x-1];
    x--;
  }
  else if(symbol=='-'){
    num[x-2]=num[x-2]-num[x-1];
    x--;
  }
  else if(symbol=='*'){
    num[x-2]=num[x-2]*num[x-1];
    x--;
  }
  else{
    
    num[x]=atoi(symbol);
    x++;
  }
  }
  printf("%d\n",num[0]);

  return 0;
}

  

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

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

void push(int);
int pop(void);
int isEmpty(void);
int isFull(void);

int top=0,S[100];

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

Compiler output:
/usr/bin/ld: /tmp/cci8ryPz.o: in function `main':
a.cc:(.text+0x16): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x1e): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x30): undefined reference to `push(int)'
/usr/bin/ld: a.cc:(.text+0x3f): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x47): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x57): undefined reference to `push(int)'
/usr/bin/ld: a.cc:(.text+0x66): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x6e): undefined reference to `pop()'
/usr/bin/ld: a.cc:(.text+0x7f): undefined reference to `push(int)'
/usr/bin/ld: a.cc:(.text+0x9a): undefined reference to `push(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

class stack{
	static const int MAX_ = 10000;
	int data_[MAX_];
	int top_;
	stack():_top(0){}
	bool isEmpty(){return top_ == 0;}
	bool isFull(){return top_ >= MAX_-1;}
	void push(int x){
		if(isFull())cout << "over flow" << endl;
		else data_[++top_] = x;
	}
	int pop(){
		if(isEmpty())cout << "under flow" << endl;
		else	return data_[top_--];
		return 0;
	}
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	char c;
	while(cin>>c,cin.eof()){
		if(c >= '0' && c <= '9'
	}
		
  return 0;
}

Compiler output:
a.cc: In constructor 'stack::stack()':
a.cc:31:17: error: class 'stack' does not have any field named '_top'
   31 |         stack():_top(0){}
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:50:40: error: expected ')' before '}' token
   50 |                 if(c >= '0' && c <= '9'
      |                   ~                    ^
      |                                        )
   51 |         }
      |         ~                               
a.cc:51:9: error: expected primary-expression before '}' token
   51 |         }
      |         ^
Language: C++

#include <iostream>
#include <stack>
#include <string>
#include <sstream>
using namespace std;
??
int main()
{
????????stack<int> S;
??
????????string expr;
????????getline(cin, expr); // 1???????????????
??
????????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:6:1: error: expected unqualified-id before '?' token
    6 | ??
      | ^