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

#include <string>
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;
#define N 1000
void push(int x);	//
int pop(void);		//
int isEmpty(void);	//
int isFull(void);
void initialize(void);
int S[N], top = 0;
int main(void)
{
	char op[13], str[2400] = {'\0'};
	int x,a, b, cou = 0;
	gets(str);
	for (int i = 0, j = 0; str[i - 1] != '\0'; i++) {
		if (str[i] != ' ' && str[i] != '\0') {
			op[j] = str[i]; j++;
		}
		else{
			op[j] = '\0';
			switch (op[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;
			case '/': a = pop(); b = pop(); push(b / a); break;
			default: sscanf(op, "%d", &x); push(x);
			}
			j = 0;
		}
	}
	printf("%d", pop());
}
void push(int x)
{
	if (!(isFull())) {
		top++;
		S[top] = x;
	}
}
int pop(void)
{
	if (!(isEmpty())) {
		top--;
		return (S[top + 1]);
	}
}
int isEmpty(void) 
{
	if (top == 0) return 1;
	else return 0;
}
int isFull(void)
{
	if (top >= N - 1) return 1;
	else return 0;
}
void initialize(void)
{
	top = 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |         gets(str);
      |         ^~~~
      |         getw
a.cc: In function 'int pop()':
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
Language: C++

#include <stdio.h>
#include <string>
#include <math.h>
#include <iostream>
using namespace std;
#define N 1000
void push(int x);	//
int pop(void);		//
int isEmpty(void);	//
int isFull(void);
void initialize(void);
int S[N], top = 0;
int main(void)
{
	char op[13], str[2400] = {'\0'};
	int x,a, b, cou = 0;
	gets_s(str, sizeof(str) - 1);
	for (int i = 0, j = 0; str[i - 1] != '\0'; i++) {
		if (str[i] != ' ' && str[i] != '\0') {
			op[j] = str[i]; j++;
		}
		else{
			op[j] = '\0';
			switch (op[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;
			case '/': a = pop(); b = pop(); push(b / a); break;
			default: sscanf_s(op, "%d", &x); push(x);
			}
			j = 0;
		}
	}
	printf_s("%d\n", pop());
}
void push(int x)
{
	if (!(isFull())) {
		top++;
		S[top] = x;
	}
}
int pop(void)
{
	if (!(isEmpty())) {
		top--;
		return (S[top + 1]);
	}
}
int isEmpty(void) 
{
	if (top == 0) return 1;
	else return 0;
}
int isFull(void)
{
	if (top >= N - 1) return 1;
	else return 0;
}
void initialize(void)
{
	top = 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'gets_s' was not declared in this scope
   17 |         gets_s(str, sizeof(str) - 1);
      |         ^~~~~~
a.cc:29:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   29 |                         default: sscanf_s(op, "%d", &x); push(x);
      |                                  ^~~~~~~~
      |                                  sscanf
a.cc:34:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   34 |         printf_s("%d\n", pop());
      |         ^~~~~~~~
      |         printf
a.cc: In function 'int pop()':
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
Language: C++

#include <stdio.h>
#include <string>
#include <math.h>
#include <iostream>
using namespace std;
#define N 1000
void push(int x);	//
int pop(void);		//
int isEmpty(void);	//
int isFull(void);
void initialize(void);
int S[N], top = 0;
int main(void)
{
	char op[13];
	int x,a, b, cou = 0;
	while(scanf("%s",op) != EOF){
		switch (op[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;
			case '/': a = pop(); b = pop(); push(b / a); break;
			default: sscanf_s(op, "%d", &x); push(x);
		}
	}
	printf("%d\n", pop());
}
void push(int x)
{
	if (!(isFull())) {
		top++;
		S[top] = x;
	}
}
int pop(void)
{
	if (!(isEmpty())) {
		top--;
		return (S[top + 1]);
	}
}
int isEmpty(void) 
{
	if (top == 0) return 1;
	else return 0;
}
int isFull(void)
{
	if (top >= N - 1) return 1;
	else return 0;
}
void initialize(void)
{
	top = 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   23 |                         default: sscanf_s(op, "%d", &x); push(x);
      |                                  ^~~~~~~~
      |                                  sscanf
a.cc: In function 'int pop()':
a.cc:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
Language: C++

#include <stdio.h>
#include <string>
#include <math.h>
#include <iostream>
using namespace std;
void push(int x);	//
int pop(void);		//
int isEmpty(void);	//
int isFull(void);
void initialize(void);
static int S[N], top = 0;
int main(void)
{
	char op[13];
	int x,a, b, cou = 0;
	while(scanf("%s",op) != EOF){
		switch (op[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;
			case '/': a = pop(); b = pop(); push(b / a); break;
			default: sscanf(op, "%d", &x); push(x);
		}
	}
	printf("%d\n", pop());
}
void push(int x)
{
	if (!(isFull())) {
		top++;
		S[top] = x;
	}
}
int pop(void)
{
	if (!(isEmpty())) {
		top--;
		return (S[top + 1]);
	}
}
int isEmpty(void) 
{
	if (top == 0) return 1;
	else return 0;
}
int isFull(void)
{
	if (top >= N - 1) return 1;
	else return 0;
}
void initialize(void)
{
	top = 0;
}

Compiler output:
a.cc:11:14: error: 'N' was not declared in this scope
   11 | static int S[N], top = 0;
      |              ^
a.cc: In function 'void push(int)':
a.cc:31:17: error: 'S' was not declared in this scope
   31 |                 S[top] = x;
      |                 ^
a.cc: In function 'int pop()':
a.cc:38:25: error: 'S' was not declared in this scope
   38 |                 return (S[top + 1]);
      |                         ^
a.cc: In function 'int isFull()':
a.cc:48:20: error: 'N' was not declared in this scope
   48 |         if (top >= N - 1) return 1;
      |                    ^
a.cc:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <stdlib>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    stack<long> st;
    string s;
    while (cin >> s) {
        if (s == "+") {
            long a = st.top(); st.pop();
            long b = st.top(); st.pop();
            st.push(a+b);
        }else if (s == "-") {
            long a = st.top(); st.pop();
            long b = st.top(); st.pop();
            st.push(b-a);
        }else if (s == "*") {
            long a = st.top(); st.pop();
            long b = st.top(); st.pop();
            st.push(a*b);
        }else { // number
            st.push(stoi(s));
        }
    }
    cout << st.top() << endl;
    return 0;
}

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

main(){
  int op1,op2;
  int pmb;
  scanf("%d",&op1);  
  while(scanf("%d",&op2)!=EOF){
    pmb = getchar();
    switch(pmb){
      case '+': op1+=op2;
        break;
      case '-': op1-=op2;
        break;
      case '*': op1*=op2;
        break;
    }
  }
  printf("%d\n",op1);
}
    

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'scanf' was not declared in this scope
    4 |   scanf("%d",&op1);
      |   ^~~~~
a.cc:5:27: error: 'EOF' was not declared in this scope
    5 |   while(scanf("%d",&op2)!=EOF){
      |                           ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
a.cc:6:11: error: 'getchar' was not declared in this scope
    6 |     pmb = getchar();
      |           ^~~~~~~
a.cc:6:11: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:16:3: error: 'printf' was not declared in this scope
   16 |   printf("%d\n",op1);
      |   ^~~~~~
a.cc:16:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#inlude<stdio.h>
main(){
  char op[10000000000];
  int memory[100];
  int cnt = 0,num;
  while(scanf("%s",op)!=EOF){
    if(op=="+"){
      memory[cnt-1] += memory[cnt];
      cnt--;
    }else if(op=="-"){
      memory[cnt-1] -= memory[cnt];
      cnt--;
    }else if(op=="*"){
      memory[cnt-1] *= memory[cnt];
      cnt--;
    }else{
      num = atoi(op);
      memory[cnt] = num;
      cnt++;
    }
  }
  printf("%d\n",memory[0]);
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<stdio.h>
      |  ^~~~~~
      |  include
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
    6 |   while(scanf("%s",op)!=EOF){
      |         ^~~~~
a.cc:6:25: error: 'EOF' was not declared in this scope
    6 |   while(scanf("%s",op)!=EOF){
      |                         ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inlude<stdio.h>
a.cc:17:13: error: 'atoi' was not declared in this scope
   17 |       num = atoi(op);
      |             ^~~~
a.cc:22:3: error: 'printf' was not declared in this scope
   22 |   printf("%d\n",memory[0]);
      |   ^~~~~~
a.cc:22:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdio.h>
#include<stdlib.h>
main(){
  char op[1000200];
  int memory[100],cnt=0;
  while(scanf(%s,op)!=EOF){
    if(op=="+"){
      memory[cnt-2]+=memory[cnt-1];
      cnt--;
    }else if(op=="-"){
      memory[cnt-2]-=memory[cnt-1];
      cnt--;
    }else if(op=="*"){
      memory[cnt-2]*=memory[cnt-1];
      cnt--;
    }else{
      memory[cnt]=atoi(op);
      cnt++;
    }
  }
  printf("%d\n",memory[0]);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before '%' token
    6 |   while(scanf(%s,op)!=EOF){
      |               ^
a.cc:6:16: error: 's' was not declared in this scope
    6 |   while(scanf(%s,op)!=EOF){
      |                ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
main(){
  char op[1000200];
  int memory[100],cnt=0;
  while(scanf("%s",op)!=EOF){
    if(op=="+")||(op=="+\n"){
      memory[cnt-2]+=memory[cnt-1];
      cnt--;
    }else if(op=="-"){
      memory[cnt-2]-=memory[cnt-1];
      cnt--;
    }else if(op=="*"){
      memory[cnt-2]*=memory[cnt-1];
      cnt--;
    }else{
      memory[cnt]=atoi(op);
      cnt++;
    }
  }
  printf("%d\n",memory[0]);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:16: error: expected primary-expression before '||' token
    7 |     if(op=="+")||(op=="+\n"){
      |                ^~
Language: C++

#include<iostream>
#include <cstdio>
#include <algorithm>

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",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 {
			push(atoi(s));
		}
	}

	cout << pop()<<endl;

	return 0;

}

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

#include<iostream>
#include<stack>
using namespace std;
int main(){
	stack<int> st;
	char c;
	while(cin >> c){
		if( isdigit(c) != 0 ){ //??°?????§????????°
			int x = (int)(c - '0'); //char -> int
			st.push(x);
		}else{ //???????????§????????°
			int y = st.top();
			st.pop();
			int z = st.pop();
			st.pop();
			switch(c){
				case('+'):
					st.push(z + y);
					break;
				case('-'):
					st.push(z - y);
					break;
				case('*'):
					st.push(z * y):
					break;
			}
		}
	}
	cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:39: error: void value not ignored as it ought to be
   14 |                         int z = st.pop();
      |                                 ~~~~~~^~
a.cc:24:55: error: expected ';' before ':' token
   24 |                                         st.push(z * y):
      |                                                       ^
      |                                                       ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	stack<int> st;
	char c;
	while( cin >> c ){
		if( isdigit(c) != 0 ){ //??°?????§????????°
			st.push( atoi(c) );
		}else{ //???????????§????????°
			int y = st.top(); st.pop();
			int z = st.top(); st.pop();
			switch(c){
				case('+'): st.push(z + y); break;
				case('-'): st.push(z - y); break;
				case('*'): st.push(z * y); break;
			}
		}
	}
	cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    8 |                         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++

#include<bits/stdc++.h>
using namespace std;
stack<int> st;
int main(){
	char c;
	while( cin >> c ){
		if( isdigit(c) != 0 ){
			st.push( atoi(c) );
		}else{
			int y = st.top(); st.pop();
			int z = st.top(); st.pop();
			switch(c){
				case('+'): st.push(z + y); break;
				case('-'): st.push(z - y); break;
				case('*'): st.push(z * y); break;
			}
		}
	}
	cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    8 |                         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++

#include<iostream>
#include<stack>
#include<cstdlib>
using namespace std;
stack<int> st;
int main(){
	char c;
	while( cin >> c ){
		if( isdigit(c) != 0 ){
			st.push( atoi(c) );
		}else{
			int y = st.top(); st.pop();
			int z = st.top(); st.pop();
			switch(c){
				case('+'): st.push(z + y); break;
				case('-'): st.push(z - y); break;
				case('*'): st.push(z * y); break;
			}
		}
	}
	cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   10 |                         st.push( atoi(c) );
      |                                       ^
      |                                       |
      |                                       char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/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<stack>
#include<cstdlib>
using namespace std;
stack<int> s;
int main(){
	int x, y;
	char c;
	while( cin >> c ){
		if ( c == '+' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(a+b);
		}
		else if( c == '-' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(b-a);
		}
		else if( c == '*' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(a*b);
		}else{
			x = atoi(c);
			s.push(x);
		}
	}
			cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'a' was not declared in this scope
   13 |                         s.push(a+b);
      |                                ^
a.cc:13:34: error: 'b' was not declared in this scope
   13 |                         s.push(a+b);
      |                                  ^
a.cc:18:32: error: 'b' was not declared in this scope
   18 |                         s.push(b-a);
      |                                ^
a.cc:18:34: error: 'a' was not declared in this scope
   18 |                         s.push(b-a);
      |                                  ^
a.cc:23:32: error: 'a' was not declared in this scope
   23 |                         s.push(a*b);
      |                                ^
a.cc:23:34: error: 'b' was not declared in this scope
   23 |                         s.push(a*b);
      |                                  ^
a.cc:25:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   25 |                         x = atoi(c);
      |                                  ^
      |                                  |
      |                                  char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:29:33: error: 'st' was not declared in this scope; did you mean 'std'?
   29 |                         cout << st.top() << "?\n";
      |                                 ^~
      |                                 std
Language: C++

#include<iostream>
#include<stack>
#include<cstdlib>
using namespace std;
stack<int> s;
int main(){
	int x, y;
	char c;
	while( cin >> c ){
		if ( c == '+' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(x+y);
		}
		else if( c == '-' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(y-x);
		}
		else if( c == '*' ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push(x*y);
		}else{
			x = atoi(c);
			s.push(x);
		}
	}
			cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   25 |                         x = atoi(c);
      |                                  ^
      |                                  |
      |                                  char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:29:33: error: 'st' was not declared in this scope; did you mean 'std'?
   29 |                         cout << st.top() << "?\n";
      |                                 ^~
      |                                 std
Language: C++

#include<iostream>
#include<stack>
#include<string>
#include<cstdlib>
using namespace std;
stack<int> s;
int main(){
	int x, y;
	string c;
	while( cin >> c ){
		if ( c == "+" ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push( x + y );
		}
		else if( c == "-" ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push( y - x );
		}
		else if( c == "*" ){
			x = s.top(); s.pop();
			y = s.top(); s.pop();
			s.push( x * y );
		}else{
			x = atoi( c );
			s.push( x );
		}
	}
			cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   26 |                         x = atoi( c );
      |                                   ^
      |                                   |
      |                                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:30:33: error: 'st' was not declared in this scope; did you mean 'std'?
   30 |                         cout << st.top() << "?\n";
      |                                 ^~
      |                                 std
Language: C++

#include<iostream>
#include<stack>
#include<cstdlib>
#include<string>
using namespace std;

int main(){
	stack<int> st;
	string s;
	int a, b, num;
	
	while ( cin >> s ){
		if( s == "+" ){
			a = st.top(); st.pop();
			b = st.top(); st.pop();
			st.push(a + b);
		}
		else if( s == "-" ){
			a = st.top(); st.pop();
			b = st.top(); st.pop();
			st.push(b - a);			
		}
		else if( s == "*" ){
			a = st.top(); st.pop();
			b = st.top(); st.pop();
			st.push(a * b);
		}
		else{
			num = atoi( s.c_str() ):
			st.push( num );
	}
	cout << st.top() << "?\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:48: error: expected ';' before ':' token
   29 |                         num = atoi( s.c_str() ):
      |                                                ^
      |                                                ;
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<stack>
#include<cstdlib>
#include<string>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

int main(){
  stack<int> t;
  string s;
  int a,b,c;
  while(cin>>s){
    if('0'<=s[0]&&s[0]<='9'){
      t.push(atoi(s));
      }
      else t.push(s[0]-'0');
    }
    else if(s=="+"){
      a=t.top();t.pop();
      b=t.top();t.pop();
      t.push(a+b);
    }
    else if(s=="-"){
      a=t.top();t.pop();
      b=t.top();t.pop();
      t.push(b-a);
    }
    else if(s=="*"){
      a=t.top();t.pop();
      b=t.top();t.pop();
      t.push(a*b);     
    }
  }
  cout <<t.top()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |       t.push(atoi(s));
      |                   ^
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:16:5: error: 'else' without a previous 'if'
   16 |     else if(s=="+"){
      |     ^~~~
a.cc: At global scope:
a.cc:32:3: error: 'cout' does not name a type
   32 |   cout <<t.top()<<endl;
      |   ^~~~
a.cc:33:3: error: expected unqualified-id before 'return'
   33 |   return 0;
      |   ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

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

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

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

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

Compiler output:
a.cc:15:8: error: expected '}' before ';' token
   15 |  top --;
      |        ^
a.cc:14:8: note: to match this '{'
   14 | int pop{
      |        ^
a.cc:16:2: error: expected unqualified-id before 'return'
   16 |  return S[top+1];
      |  ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
a.cc: In function 'int main()':
a.cc:21:21: error: 'n' was not declared in this scope
   21 | while (scanf("%s", &n) != EOF){
      |                     ^
a.cc:23:10: error: 'pop' cannot be used as a function
   23 |     v=pop() + pop();
      |       ~~~^~
a.cc:23:18: error: 'pop' cannot be used as a function
   23 |     v=pop() + pop();
      |               ~~~^~
a.cc:26:10: error: 'pop' cannot be used as a function
   26 |     v=pop() - pop();
      |       ~~~^~
a.cc:26:18: error: 'pop' cannot be used as a function
   26 |     v=pop() - pop();
      |               ~~~^~
a.cc:29:10: error: 'pop' cannot be used as a function
   29 |     v=pop() * pop();
      |       ~~~^~
a.cc:29:18: error: 'pop' cannot be used as a function
   29 |     v=pop() * pop();
      |               ~~~^~
a.cc:35:20: error: 'pop' cannot be used as a function
   35 |   printf("%d\n",pop());
      |                 ~~~^~
Language: C++

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

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

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

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

Compiler output:
a.cc:15:7: error: expected '}' before ';' token
   15 |  top--;
      |       ^
a.cc:14:8: note: to match this '{'
   14 | int pop{
      |        ^
a.cc:16:2: error: expected unqualified-id before 'return'
   16 |  return S[top+1];
      |  ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
a.cc: In function 'int main()':
a.cc:21:21: error: 'n' was not declared in this scope
   21 | while (scanf("%s", &n) != EOF){
      |                     ^
a.cc:23:10: error: 'pop' cannot be used as a function
   23 |     v=pop() + pop();
      |       ~~~^~
a.cc:23:18: error: 'pop' cannot be used as a function
   23 |     v=pop() + pop();
      |               ~~~^~
a.cc:26:10: error: 'pop' cannot be used as a function
   26 |     v=pop() - pop();
      |       ~~~^~
a.cc:26:18: error: 'pop' cannot be used as a function
   26 |     v=pop() - pop();
      |               ~~~^~
a.cc:29:10: error: 'pop' cannot be used as a function
   29 |     v=pop() * pop();
      |       ~~~^~
a.cc:29:18: error: 'pop' cannot be used as a function
   29 |     v=pop() * pop();
      |               ~~~^~
a.cc:35:20: error: 'pop' cannot be used as a function
   35 |   printf("%d\n",pop());
      |                 ~~~^~
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'n' was not declared in this scope
   21 | while (scanf("%s", &n) != EOF){
      |                     ^
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |   if (n[0] == "+"){
      |       ~~~~~^~~~~~
a.cc:26:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |   }else if (n[0] == "-"){
      |             ~~~~~^~~~~~
a.cc:29:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |   }else if (n[0] == "*"){
      |             ~~~~~^~~~~~
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |   if (n[0] == "+"){
      |       ~~~~~^~~~~~
a.cc:26:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |   }else if (n[0] == "-"){
      |             ~~~~~^~~~~~
a.cc:29:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |   }else if (n[0] == "*"){
      |             ~~~~~^~~~~~
Language: C++

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

int main(){
    string word;
    stack<int> S;
    while(cin >> word){
        if(word == "+"){
            int x = S.pop(), y = S.pop();
            S.push(y - x);
        }
        else if(word == "-"){
            int x = S.pop(), y = S.pop();
            S.push(y - x);
        }
        else if(word == "*"){
            int x = S.pop(), y = S.pop();
            S.push(y - x);
        }
        else{
            int i;
            istringstream(word) >> i;
            S.push(i);
        }
    }
    printf("%d\n", S.pop());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: void value not ignored as it ought to be
   11 |             int x = S.pop(), y = S.pop();
      |                     ~~~~~^~
a.cc:11:39: error: void value not ignored as it ought to be
   11 |             int x = S.pop(), y = S.pop();
      |                                  ~~~~~^~
a.cc:15:26: error: void value not ignored as it ought to be
   15 |             int x = S.pop(), y = S.pop();
      |                     ~~~~~^~
a.cc:15:39: error: void value not ignored as it ought to be
   15 |             int x = S.pop(), y = S.pop();
      |                                  ~~~~~^~
a.cc:19:26: error: void value not ignored as it ought to be
   19 |             int x = S.pop(), y = S.pop();
      |                     ~~~~~^~
a.cc:19:39: error: void value not ignored as it ought to be
   19 |             int x = S.pop(), y = S.pop();
      |                                  ~~~~~^~
a.cc:24:31: error: invalid use of incomplete type 'std::istringstream' {aka 'class std::__cxx11::basic_istringstream<char>'}
   24 |             istringstream(word) >> i;
      |                               ^
In file included from /usr/include/c++/14/bits/localefwd.h:41,
                 from /usr/include/c++/14/string:45,
                 from a.cc:1:
/usr/include/c++/14/iosfwd:102:11: note: declaration of 'std::istringstream' {aka 'class std::__cxx11::basic_istringstream<char>'}
  102 |     class basic_istringstream;
      |           ^~~~~~~~~~~~~~~~~~~
a.cc:28:25: error: invalid use of void expression
   28 |     printf("%d\n", S.pop());
      |                    ~~~~~^~
Language: C++

#include <string>
#include <stack>
#include <stdio>
#include <iostream>
using namespace std;

int main(){
    string word;
    stack<int> S;
    while(cin >> word){
        if(word == "+"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y + x);
        }
        else if(word == "-"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y - x);
        }
        else if(word == "*"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y * x);
        }
        else{
            int i = stoi(word);
            S.push(i);
        }
    }
    printf("%d\n", S.top());
}

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

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

int main(){
    string word;
    stack<int> S;
    while(cin >> word){
        if(word == "+"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y + x);
        }
        else if(word == "-"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y - x);
        }
        else if(word == "*"){
            int x = S.top();
            S.pop();
            int y = S.top();
            S.pop();
            S.push(y * x);
        }
        else{
            int i;
            sscanf(str.c_str(), "%d", &i);
            S.push(i);
        }
    }
    printf("%d\n", S.top());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:20: error: 'str' was not declared in this scope; did you mean 'std'?
   34 |             sscanf(str.c_str(), "%d", &i);
      |                    ^~~
      |                    std
Language: C++


#include<string>
#include<stack>
#include<iostream>
#include<stdlib.c>
using namespace std;
int main(){
    string word;
    stack<int>S;
    int n,n1,n2,p;
    while(cin>>word){
        if(word=="+"){
            n1=S.top();
            S.pop();
            n2=S.top();
            S.pop();
            n=n1+n2;
            S.push(n);
        }
        else if(word=="-"){
            n1=S.top();
            S.pop();
            n2=S.top();
            S.pop();
            n=n2-n1;
            S.push(n);
        }
        else if(word=="*"){
            n1=S.top();
            S.pop();
            n2=S.top();
            S.pop();
            n=n1*n2;
            S.push(n);
        }
        else {
            p=atoi(word.c_str());
            S.push(p);
        }
    }
    cout<<S.top()<<endl;
    return S.top();
}

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

#include <cstdio>
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(b - a);
    } 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:33:12: error: 'atoi' was not declared in this scope
   33 |       push(atoi(s));
      |            ^~~~
Language: C++

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

using namespace std;

class stack
{
	public:
	int s[100];
	int t;

public:
	void initialize();
	void push(int x);
	int pop();
};

void stack::initialize()
{
	t = 0;
}

void stack::push(int x)
{
	s[t] = x;
	t++;
}

int stack::pop()
{
	t--;
	return s[t];
}



int main()
{
	stack st;
	char ch;
	int a,b;

	st.initialize();

	while(cin >> ch)
	{
		if (ch == '+')
		{
			a = st.pop();
			
			b = st.pop();
			
			st.push(a+b);

		
		}
		else if (ch == '-')
		{
			a = st.pop();
			
			b = st.pop();
			
			st.push(b-a);

		
		}
		else if (ch == '*')
		{
			a = st.pop();
			
			b = st.pop();
			
			st.push(a*b);

			
		else
		{
			st.push(atoi(&ch));
		}

	}

	cout << st.s[0] << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:17: error: expected '}' before 'else'
   77 |                 else
      |                 ^~~~
a.cc:69:17: note: to match this '{'
   69 |                 {
      |                 ^
Language: C++

#include <bits\stdc++.h>
#define _CRT_
using namespace std;

int main()
{
	stack<int> S;
	string s;
	while (cin >> s)
	{
		//printf("input:%s.", s.c_str());
		if (s == "+")
		{
			//printf("i got +.\n");
			int right = S.top(); S.pop();
			int left = S.top();	S.pop();
			S.push(right + left);
			continue;
		}
		if (s == "-")
		{
			//printf("i got -.\n");
			int right = S.top(); S.pop();
			int left = S.top();	S.pop();
			S.push(left - right);
			continue;
		}
		if (s == "*")
		{
			//printf("i got *.\n");
			int right = S.top(); S.pop();
			int left = S.top();	S.pop();
			S.push(right * left);
			continue;
		}
		//printf("i got number\n");
		S.push(stoi(s));
	}
	printf("%d\n", S.top());
	return 0;

}

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

#include <iostream>
using namespace std;

int main(){
    string s;
    int n=0,a[50];
    getline(cin, s);
    s[1]=s[2];
    for(int i=2;i<(s.size()+1)/2;i++){
        s[i]=s[i*2];
        if(0<=s[i-1]-'0'&&s[i-1]-'0'<=9){
            int x=s[i-2]-'0',y=s[i-1]-'0';
            if(s[i]=='+')a[n]=x+y,n++;
            if(s[i]=='-')a[n]=x-y,n++;
            if(s[i]=='*')a[n]=x*y,n++;

Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: expected '}' at end of input
   15 |             if(s[i]=='*')a[n]=x*y,n++;
      |                                       ^
a.cc:11:41: note: to match this '{'
   11 |         if(0<=s[i-1]-'0'&&s[i-1]-'0'<=9){
      |                                         ^
a.cc:15:39: error: expected '}' at end of input
   15 |             if(s[i]=='*')a[n]=x*y,n++;
      |                                       ^
a.cc:9:38: note: to match this '{'
    9 |     for(int i=2;i<(s.size()+1)/2;i++){
      |                                      ^
a.cc:15:39: error: expected '}' at end of input
   15 |             if(s[i]=='*')a[n]=x*y,n++;
      |                                       ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
	stack<int> si;
	char str[10010];
	gets(str);
	for(int i=0;i<strlen(str);i++)
	{
		//printf("%d\n",i);
		if(isdigit(str[i]))
		{
			int t;
			sscanf(&str[i],"%d",&t);
			si.push(t);
			while(isdigit(str[i])) i++;
		}
		else if(str[i]=='+')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1+s2);
			i++;
		}
		else if(str[i]=='-')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s2-s1);
			i++;
		}
		else if(str[i]=='*')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1*s2);
			i++;
		}
	}
	printf("%d\n",si.top());
}

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

#include<bits/stdc++.h>

using namespace std;

int main()
{
	stack<int> si;
	char str[10010];
	gets(str);
	for(int i=0;i<strlen(str);i++)
	{
		//printf("%d\n",i);
		if(isdigit(str[i]))
		{
			int t;
			sscanf(&str[i],"%d",&t);
			si.push(t);
			while(isdigit(str[i])) i++;
		}
		else if(str[i]=='+')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1+s2);
			i++;
		}
		else if(str[i]=='-')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s2-s1);
			i++;
		}
		else if(str[i]=='*')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1*s2);
			i++;
		}
	}
	printf("%d\n",si.top());
	return 0;
}

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

#include<bits/stdc++.h>
#include<string.h>

using namespace std;

int main()
{
	stack<int> si;
	char str[10010];
	gets(str);
	for(int i=0;i<strlen(str);i++)
	{
		//printf("%d\n",i);
		if(isdigit(str[i]))
		{
			int t;
			sscanf(&str[i],"%d",&t);
			si.push(t);
			while(isdigit(str[i])) i++;
		}
		else if(str[i]=='+')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1+s2);
			i++;
		}
		else if(str[i]=='-')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s2-s1);
			i++;
		}
		else if(str[i]=='*')
		{
			int s1=si.top();si.pop();
			int s2=si.top();si.pop();
			si.push(s1*s2);
			i++;
		}
	}
	printf("%d\n",si.top());
	return 0;
}

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

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

char stack[200];
int top = 0;

bool isFull()
{
	if (top == 199) {
		return true;
	}
	return false;
}

bool isEmpty()
{
	if (top == -1) {
		return true;
	}
	return false;
}

int pop()
{
	if (isEmpty()) {
		printf("Stack is empty.\n");
		exit(EXIT_FAILURE);
	}
	return stack[top--];
}

void push(int x)
{
	if (isFull()) {
		printf("Stack is full.\n");
		exit(EXIT_FAILURE);
	}
	else {
		stack[top] = x;
		top++;
	}
}

int main(int argc, char** argv)
{
	char s[200];

	while (scanf_s("%s",s,200) != EOF)
	{
		if (s[0] == '+') {
			int x = pop();
			int y = pop();
			push(y + x);
		}
		else if (s[0] == '-') {
			int x = pop();
			int y = pop();
			push(y - x);
		}
		else if (s[0] == '*') {
			int x = pop();
			int y = pop();
			push(y * x);
		}
		else {
			int x = atoi(s);
			push(x);
		}
	}
	printf("%d\n", pop());

	return 0;
}

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

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

int stack[100];
int top = 0;

bool isFull()
{
	if (top == 199) {
		return true;
	}
	return false;
}

bool isEmpty()
{
	if (top == -1) {
		return true;
	}
	return false;
}

int pop()
{
	if (isEmpty()) {
		printf("Stack is empty.\n");
		exit(EXIT_FAILURE);
	}
	return stack[--top];
}

void push(int x)
{
	if (isFull()) {
		printf("Stack is full.\n");
		exit(EXIT_FAILURE);
	}
	else {
		stack[top] = x;
		top++;
	}
}

int main(int argc, char** argv)
{
	char s[200];

	while (scanf_s("%s",s,200) != EOF)
	{
		if (s[0] == '+') {
			int x = pop();
			int y = pop();
			push(y + x);
		}
		else if (s[0] == '-') {
			int x = pop();
			int y = pop();
			push(y - x);
		}
		else if (s[0] == '*') {
			int x = pop();
			int y = pop();
			push(y * x);
		}
		else {
			int x = atoi(s);
			push(x);
		}
	}
	printf("%d", pop());

	return 0;
}

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