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

/* last edited at 29/8/2015 by charis
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A
*/

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;

class stack{
public:
int top;
int S[];

	void initialize(){
		top = 0;
	}

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

	int isFull(){
		return top>=100;
	}

	void push(int x){
		if(isFull()) cout << "Error" << endl;
		else {
			top++;
			S[top]=x;		
		}	
	}

	int pop(){
		if(isEmpty()) cout << "Error" << endl;
		top--;		
		return S[top+1];
	}
};

int main(){
	stack s;
	char C[100];
	s.initialize();
	while(scanf("%s", C) != EOF ){
		if ( C[0] == '+' ){
			int a = s.pop();
			int b = s.pop();	
			s.push(a+b); 
		}	
		else if ( C[0] == '-' ) {
			int a = s.pop();
			int b = s.pop();	
			s.push(a-b); 			
		}
		else if ( C[0] == '*' ) {
			int a = s.pop();
			int b = s.pop();	
			s.push(a*b); 			
		}
		else {
			int x = atoi(C);
			s.push(x);
		}
		cout << C << " ";
	} 
    while (s.size()) {
        cout << s.pop() << endl;
    }
	
	return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:69:14: error: 'class stack' has no member named 'size'
   69 |     while (s.size()) {
      |              ^~~~
Language: C++

while que  =  gets
  que.chomp
    stack = []
    que = que.split(" ")

    while que.size>0
      a = que.shift
      if  a == "+"
        x = stack.shift.to_i + stack.shift.to_i
        stack.unshift(x)
      elsif a == "-"
        x = -stack.shift.to_i + stack.shift.to_i
      elsif a == "*"
        x = stack.shift.to_i * stack.shift.to_i 
      else
        x = a
      end
      stack.unshift(x)
    
    end
    puts stack[0]
  end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while que  =  gets
      | ^~~~~
Language: C++

#include <iostream>
#include <stack>
 
using namespace std;
 
char expr[10000];
 
int main() {
    stack<long> S;
    cin.getline(expr, 10000);
    char* s = expr;
    for (;;) {
        if (*s == '\0') { break; }
        if ('0' <= *s && *s <= '9') {
            S.push(strtol(s, &s, 10));
            if (*s == ' ') { ++s; }
        } else {
            long b = S.top(); S.pop();
            long a = S.top(); S.pop();
            long r = 0;
            switch (*s) {
                case '+':
                    r = a + b;
                    break;
                case '-':
                    r = a - b;
                    break;
                case '*':
                    r = a * b;
                    break;
            }
            ++s;
            if (*s == ' ') { ++s; }
            S.push(r);
        }
    }
    cout << S.top() << endl;
    return
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:1: error: expected primary-expression before '}' token
   39 | }
      | ^
a.cc:38:11: error: expected ';' before '}' token
   38 |     return
      |           ^
      |           ;
   39 | }
      | ~
Language: C++

#include <iostream>
#include <stack>
 
using namespace std;
 
char expr[10000];
 
int main() {
    stack<long> S;
    cin.getline(expr, 10000);
    char* s = expr;
    for (;;) {
        if (*s == '\0') { break; }
        if ('0' <= *s && *s <= '9') {
            S.push(strtol(s, &s, 10));
            if (*s == ' ') { ++s; }
        } else {
            long b = S.top(); S.pop();
            long a = S.top(); S.pop();
            long r = 0;
            switch (*s) {
                case '+':
                    r = a + b;
                    break;
                case '-':
                    r = a - b;
                    break;
                case '*':
                    r = a * b;
                    break;
            }
            ++s;
            if (*s == ' ') { ++s; }
            S.push(r);
        }
    }
    cout << S.top() << endl;
    return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   38 |     return;
      |     ^~~~~~
Language: C++


int main(){
  string word;
  stack<int> S;
  while(cin >> word){
    if(word == "+"){
      int m = S.top();
      S.pop();
      int n = S.top();
      S.pop();
      S.push(m+n);
    }
    else if(word == "-"){
      int m = S.top();
      S.pop();
      int n = S.top();
      S.pop();
      S.push(n-m);
    }
    else if(word == "*"){
      int m = S.top();
      S.pop();
      int n = S.top();
      S.pop();
      S.push(m*n);
    }
    else{
      S.push(atoi(word.c_str()));
    }
  }
  int p = S.top();
  cout << p << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string word;
      |   ^~~~~~
a.cc:4:3: error: 'stack' was not declared in this scope
    4 |   stack<int> S;
      |   ^~~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |   stack<int> S;
      |         ^~~
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |   while(cin >> word){
      |         ^~~
a.cc:5:16: error: 'word' was not declared in this scope
    5 |   while(cin >> word){
      |                ^~~~
a.cc:7:15: error: 'S' was not declared in this scope
    7 |       int m = S.top();
      |               ^
a.cc:14:15: error: 'S' was not declared in this scope
   14 |       int m = S.top();
      |               ^
a.cc:21:15: error: 'S' was not declared in this scope
   21 |       int m = S.top();
      |               ^
a.cc:28:7: error: 'S' was not declared in this scope
   28 |       S.push(atoi(word.c_str()));
      |       ^
a.cc:28:14: error: 'atoi' was not declared in this scope
   28 |       S.push(atoi(word.c_str()));
      |              ^~~~
a.cc:31:11: error: 'S' was not declared in this scope
   31 |   int p = S.top();
      |           ^
a.cc:32:3: error: 'cout' was not declared in this scope
   32 |   cout << p << endl;
      |   ^~~~
a.cc:32:16: error: 'endl' was not declared in this scope
   32 |   cout << p << endl;
      |                ^~~~
Language: C++

#include <iostream>
using namespace std;

int top, S[1000];

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

int pop()
{
	top--;

	return S[top+1];
}

int main(void)
{
	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:6:6: error: variable or field 'push' declared void
    6 | void push(x)
      |      ^~~~
a.cc:6:11: error: 'x' was not declared in this scope
    6 | void push(x)
      |           ^
a.cc: In function 'int main()':
a.cc:30:25: error: 'push' was not declared in this scope
   30 |                         push(a + b);
      |                         ^~~~
a.cc:35:25: error: 'push' was not declared in this scope
   35 |                         push(a - b);
      |                         ^~~~
a.cc:40:25: error: 'push' was not declared in this scope
   40 |                         push(a * b);
      |                         ^~~~
a.cc:43:25: error: 'push' was not declared in this scope
   43 |                         push(atoi(s));
      |                         ^~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#include <windows.h>
#pragma comment(lib, "winmm.lib")
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)


using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif

	stack<int> S;
	string tmp;
	int pop1, pop2;
	while (cin >> tmp){
		if (tmp == "+"){
			pop1 = S.top();
			S.pop();
			pop2 = S.top();
			S.pop();
			S.push(pop1 + pop2);
		}
		else if (tmp == "-"){
			pop1 = S.top();
			S.pop();
			pop2 = S.top();
			S.pop();
			S.push(pop2 - pop1);
		}else if (tmp == "*"){
			pop1 = S.top();
			S.pop();
			pop2 = S.top();
			S.pop();
			S.push(pop1 * pop2);
		}else if (tmp == "/"){
			pop1 = S.top();
			S.pop();
			pop2 = S.top();
			S.pop();
			S.push(pop2 / pop1);
		}
		else{
			S.push(stoi(tmp));
		}
	}

	cout << S.top() << endl;
	return 0;
}

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

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

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

int main(int argc, const char * argv[]){
    
    //Input
    int i,j;
    int operator = {
                    -1, /* + */
                    -2, /* - */
                    -3  /* * */
                   };
    int num;
    int threshold = 0;
    int index = 0;
    int array[200];
    int stack[200];
    char *s;
    int ans = 0;
    
    s = (char *)malloc(sizeof(char) * 20000);
    gets(s);
    
    i = 0;
    num = 0;
    while( (*(s+i)) != '\0' ){
        
        if( isdigit( *(s+i) ) ){
          
            num = num*10;
            num += ( *(s+i) - 48 );
        
        }else if( (*(s+i)) == ' ' ){
            
            if(num > 0){
                array[threshold] = num;
                threshold++;
                num = 0;
            }
            
        }else if( (*(s+i)) == '+' ){
            array[threshold] = -1;
            threshold++;
        }else if( (*(s+i)) == '-' ){
            array[threshold] = -2;
            threshold++;
        }else if( (*(s+i)) == '*' ){
            array[threshold] = -3;
            threshold++;
        }
        i++;
    }
    
    ans = 0;
    
    j = 0;
    int a,b;
    while(j < threshold){
        
        if(array[j] == -1){
            a = stack[--index];
            b = stack[--index];
            stack[index++] = a + b;
        }else if(array[j] == -2){
            a = stack[--index];
            b = stack[--index];
            stack[index++] = a - b;
        }else if(array[j] == -3){
            a = stack[--index];
            b = stack[--index];
            stack[index++] = a * b;
        }else{
            stack[index++] = array[j];
        }
        j++;
            
    }
    
    printf("%d\n", stack[--index]);
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:16:9: error: declaration of 'operator=' as non-function
   16 |     int operator = {
      |         ^~~~~~~~
a.cc:30:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   30 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

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

int value[100];
int sp = 0;

void push(const int val)
{
    value[sp++] = val;
}

int pop()
{
    return value[--sp];
}

void operand(const char operand)
{
    int ch, val = operand - '0';
    while( (ch = getchar()) != ' ' ){
        val = val * 10 + (ch - '0'); 
    }
    push(val);
}

void operator(const char operator)
{
    int tmp1 = pop(), tmp2 = pop();

    switch( operator ){
    case '+': push(tmp2 + tmp1); break;
    case '-': push(tmp2 - tmp1); break;
    case '*': push(tmp2 * tmp1); break;
    default : break;
    }
}

int main()
{
    while( 1 ){
        int ch = getchar();
        if( ch == ' ' || ch == '\n' ) continue;
        if( ch == EOF ) break;
        
        switch( ch ){
        case '+': case '-': case '*': operator(ch); break;
        default : operand(ch); break;
        }
    }

    printf("%d\n", pop());

    return 0;

Compiler output:
a.cc:26:14: error: expected type-specifier before '(' token
   26 | void operator(const char operator)
      |              ^
a.cc: In function 'int main()':
a.cc:46:47: error: expected type-specifier before '(' token
   46 |         case '+': case '-': case '*': operator(ch); break;
      |                                               ^
a.cc:53:14: error: expected '}' at end of input
   53 |     return 0;
      |              ^
a.cc:39:1: note: to match this '{'
   39 | {
      | ^
Language: C++

#include<iostream>
#include<stack>
using namespace std;
#define scanf scanf_s

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    4 | #define scanf scanf_s
      |               ^~~~~~~
a.cc:10:16: note: in expansion of macro 'scanf'
   10 |         while (scanf("%s", c) != EOF) {
      |                ^~~~~
Language: C++

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

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

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				s[top] = atoi(c[i]);
			}
		}
	}

	cout << pop() << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:50: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   33 |                                 s[top] = atoi(c[i]);
      |                                               ~~~^
      |                                                  |
      |                                                  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:38:17: error: 'pop' was not declared in this scope; did you mean 'top'?
   38 |         cout << pop() << endl;
      |                 ^~~
      |                 top
Language: C++

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

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

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				s[top] = atoi(c[i]);
			}
		}
	}

	cout << s[top] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:50: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   34 |                                 s[top] = atoi(c[i]);
      |                                               ~~~^
      |                                                  |
      |                                                  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 <string>
#include <cstdlib>
#include <sstream>
using namespace std;

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

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				s[top] = atoi(c[i].c_str());
			}
		}
	}

	cout << s[top] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:52: error: request for member 'c_str' in 'c[i]', which is of non-class type 'char'
   35 |                                 s[top] = atoi(c[i].c_str());
      |                                                    ^~~~~
Language: C++

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

int main(){
	long a, b;
	long top = 0;
	string c(200, '0');
	long s[200];

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				s[top] = atoi(c[i].c_str());
			}
		}
	}

	cout << s[top] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:52: error: request for member 'c_str' in 'c.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   35 |                                 s[top] = atoi(c[i].c_str());
      |                                                    ^~~~~
Language: C++

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

int main(){
	long a, b;
	long top = 0;
	string c(200, '0');
	long s[200];

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				const char ch = c[i];
				s[top] = atoi(ch);
			}
		}
	}

	cout << s[top] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:47: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   36 |                                 s[top] = atoi(ch);
      |                                               ^~
      |                                               |
      |                                               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 <string>
#include <cstdlib>
#include <sstream>
using namespace std;

int main(){
	long a, b;
	long top = 0;
	string c(200, '0');
	long s[200];

	for (long i = 0; i < 200; i++){
		while (cin >> c[i]){
			if (c[i] == '+'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a + b;
			}
			else if (c[i] == '-'){
				b = s[top];
				top--;
				a = s[top];
				s[top] = a - b;
			}
			else if (c[i] == '*'){
				a = s[top];
				top--;
				b = s[top];
				s[top] = a * b;
			}
			else {
				top++;
				const char* ch = c[i];
				s[top] = atoi(ch);
			}
		}
	}

	cout << s[top] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:53: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   35 |                                 const char* ch = c[i];
      |                                                     ^
      |                                                     |
      |                                                     __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
Language: C++

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

using namespace std;

class Siki {

	int stack[100];		//????????????
	int num;			//????´???°

	

public:
	Siki() {
		num = 0;
	}

	void push( int val ) {
		if (num >= 100) {
			cout << "overflow" << endl;
			return;
		}
		stack[num] = val;
		num++;
	}

	int pop() {
		if (num == 0) {
			cout << "underflow" << endl;
			return -1;
		}
		num--;
		return stack[num];
	}

	int getTop() { return stack[num-1]; }
	int getValue(int n) { return stack[n]; }

};

int main() {

	Siki s;

	//??°???????????§7??? 100?????\??????700????????\???
	//?????????99?????\?????????99????????\???
	//????¨?800????????§??????

	char input[800];
	for (int i = 0; i < 800; i++) {
		input[i] = '\0';
	}

	gets_s(input);

	int kazu = 0;
	char in[100];

	while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) {

		if(in[0] == '+'){
			int a = s.pop();
			int b = s.pop();
			s.push(a + b);
		}
		else if (in[0] == '-') {
			int a = s.pop();
			int b = s.pop();
			s.push(a - b);
		}
		else if (in[0] == '*') {
			int a = s.pop();
			int b = s.pop();
			s.push(a * b);
		}
		else if (in[0] == '/') {
			int a = s.pop();
			int b = s.pop();
			s.push(a / b);
		}
		else {
			
			s.push( atoi(in) );
			
		}
		int l = strlen(in) + 1;
		for (int i = 0; i < 800-l; i++) {
			input[i] = input[i + l];
		}
		
	}
	cout << s.pop() << endl;
	/*
	cout << "end" << endl;
	getchar();
	*/
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: 'gets_s' was not declared in this scope
   55 |         gets_s(input);
      |         ^~~~~~
a.cc:60:16: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   60 |         while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) {
      |                ^~~~~~~~
      |                sscanf
Language: C++

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

using namespace std;

class Siki {

	int stack[100];		//????????????
	int num;			//????´???°

	

public:
	Siki() {
		num = 0;
	}

	void push( int val ) {
		if (num >= 100) {
			cout << "overflow" << endl;
			return;
		}
		stack[num] = val;
		num++;
	}

	int pop() {
		if (num == 0) {
			cout << "underflow" << endl;
			return -1;
		}
		num--;
		return stack[num];
	}

	int getTop() { return stack[num-1]; }
	int getValue(int n) { return stack[n]; }

};

int main() {

	Siki s;

	//??°???????????§7??? 100?????\??????700????????\???
	//?????????99?????\?????????99????????\???
	//????¨?800????????§??????

	char input[800];
	for (int i = 0; i < 800; i++) {
		input[i] = '\0';
	}

	gets(input);

	int kazu = 0;
	char in[100];

	while (sscanf(input, "%s", in, sizeof(in) ) == 1) {

		if(in[0] == '+'){
			int a = s.pop();
			int b = s.pop();
			s.push(a + b);
		}
		else if (in[0] == '-') {
			int a = s.pop();
			int b = s.pop();
			s.push(a - b);
		}
		else if (in[0] == '*') {
			int a = s.pop();
			int b = s.pop();
			s.push(a * b);
		}
		else if (in[0] == '/') {
			int a = s.pop();
			int b = s.pop();
			s.push(a / b);
		}
		else {
			
			s.push( atoi(in) );
			
		}
		int l = strlen(in) + 1;
		for (int i = 0; i < 800-l; i++) {
			input[i] = input[i + l];
		}
		
	}
	cout << s.pop() << endl;
	/*
	cout << "end" << endl;
	getchar();
	*/
	return 0;


}

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

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

using namespace std;

class Siki {

	int stack[100];		//????????????
	int num;			//????´???°

	

public:
	Siki() {
		num = 0;
	}

	void push( int val ) {
		if (num >= 100) {
			cout << "overflow" << endl;
			return;
		}
		stack[num] = val;
		num++;
	}

	int pop() {
		if (num == 0) {
			cout << "underflow" << endl;
			return -1;
		}
		num--;
		return stack[num];
	}

	int getTop() { return stack[num-1]; }
	int getValue(int n) { return stack[n]; }

};

int main() {

	Siki s;

	//??°???????????§7??? 100?????\??????700????????\???
	//?????????99?????\?????????99????????\???
	//????¨?800????????§??????

	char input[800];
	for (int i = 0; i < 800; i++) {
		input[i] = '\0';
	}

	gets_s(input);

	int kazu = 0;
	char in[100];

	while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) {

		if(in[0] == '+'){
			int a = s.pop();
			int b = s.pop();
			s.push(b + a);
		}
		else if (in[0] == '-') {
			int a = s.pop();
			int b = s.pop();
			s.push(b - a);
		}
		else if (in[0] == '*') {
			int a = s.pop();
			int b = s.pop();
			s.push(b * a);
		}
		else if (in[0] == '/') {
			int a = s.pop();
			int b = s.pop();
			s.push(b / a);
		}
		else {
			
			s.push( atoi(in) );
			
		}
		int l = strlen(in) + 1;
		for (int i = 0; i < 800-l; i++) {
			input[i] = input[i + l];
		}
		
	}
	cout << s.pop() << endl;
	
	cout << "end" << endl;
	getchar();
	
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: error: 'gets_s' was not declared in this scope
   56 |         gets_s(input);
      |         ^~~~~~
a.cc:61:16: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   61 |         while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) {
      |                ^~~~~~~~
      |                sscanf
Language: C++

#include <stdio.h>
int main(){
  int top,stack[100];
  char input[8];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: 'atoi' was not declared in this scope
   22 |       stack[top] = atoi(input);
      |                    ^~~~
Language: C++

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

int top,P[1000000];

void push(int y) {
  P[++top] = y;
}

int pop() {
  top--;

  return P[top+1];
}

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

  while(1) {
    if(scanf("%s",&x[0]) == EOF) break;

    if(x[0] == '+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(x[0] == '-'){
      a=pop();
      b=pop();
      push(a-b);
    }
    else if(x[0] == '*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else {
      c=atoi(x);
      push(c);
    }
  }

  printf("%d\n",pop());

  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:23:8: error: 'scanf' was not declared in this scope
   23 |     if(scanf("%s",&x[0]) == EOF) break;
      |        ^~~~~
a.cc:23:29: error: 'EOF' was not declared in this scope
   23 |     if(scanf("%s",&x[0]) == EOF) break;
      |                             ^~~
a.cc:4:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <string.h>
  +++ |+#include <cstdio>
    4 | 
a.cc:46:3: error: 'printf' was not declared in this scope
   46 |   printf("%d\n",pop());
      |   ^~~~~~
a.cc:46:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

void push(int);
int pop(void);

int instack[200],stacknum=0;

int main(){
  int op2;
  char s[200];

  while(scanf("%s ",s)!=EOF){
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void push(int);
int pop(void);

int instack[200],stacknum=0;

int main(){
  int op2;
  char s[200];

  while(scanf("%s ",s)!=EOF){

    switch(s[0]){
    case '+':
      push(pop()+pop());
      break;
    case '-':
      op2 = pop();
      push(pop()-op2);
      break;
    case '*':
      op2=pop();
      push(pop()*op2);
      break;
    default:
      push(atoi(s));
      break;
    }

  }

  printf("%d\n",pop());
  return 0;
}

void push(int num){
  instack[stacknum] = num;
  stacknum++;
}

int pop(void){
  return instack[--stacknum];

}

    switch(s[0]){
    case '+':
      push(pop()+pop());
      break;
    case '-':
      op2 = pop();
      push(pop()-op2);
      break;
    case '*':
      op2=pop();
      push(pop()*op2);
      break;
    default:
      push(atoi(s));
      break;
    }

  }

  printf("%d\n",pop());
  return 0;
}

void push(int num){
  instack[stacknum] = num;
  stacknum++;
}

int pop(void){
  return instack[--stacknum];

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   24 | int main(){
      |         ^~
a.cc:24:9: note: remove parentheses to default-initialize a variable
   24 | int main(){
      |         ^~
      |         --
a.cc:24:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:24:11: error: a function-definition is not allowed here before '{' token
   24 | int main(){
      |           ^
a.cc:53:19: error: a function-definition is not allowed here before '{' token
   53 | void push(int num){
      |                   ^
a.cc:58:14: error: a function-definition is not allowed here before '{' token
   58 | int pop(void){
      |              ^
Language: C++

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


#define MAX 1000
void push(int);
int pop(void);

int Stack[MAX];
int top=0;

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

  return 0;
}

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


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

Compiler output:
a.cc: In function 'int pop()':
a.cc:52:23: error: expected '}' at end of input
   52 |   return Stack[top+1];
      |                       ^
a.cc:50:10: note: to match this '{'
   50 | int pop(){
      |          ^
Language: C++

#include <iostream>
#include <fstream>

#include <queue>

#include <string>

#include <sstream>

using namespace std;

int stoi (string str) {
	stringstream ss (str);
	int n; 

	ss >> n;

	return n;
}

int main() {

	//ifstream fin("in.txt");

	queue<int> temp;
	queue<int> main;

	char s[16];

	while(!cin.eof()) {
		cin >> s;
		if(strcmp(s,"+") == 0) {
			if(temp.empty()) {
				int ans = main.front();
				main.pop();
				while(main.empty() == 0) {
					ans += main.front();
					main.pop();
				}
				main.push(ans);
			}else {
				int ans = temp.front();
				temp.pop();
				while(temp.empty() == 0) {
					ans += temp.front();
					temp.pop();
				}
				main.push(ans);
			}
		}else if(strcmp(s,"-") == 0) {
			if(temp.empty()) {
				int ans = main.front();
				main.pop();
				while(main.empty() == 0) {
					ans -= main.front();
					main.pop();
				}
				main.push(ans);
			}else {
				int ans = temp.front();
				temp.pop();
				while(temp.empty() == 0) {
					ans -= temp.front();
					temp.pop();
				}
				main.push(ans);
			}
		}else if(strcmp(s,"*") == 0) {
			if(temp.empty()) {
				int ans = main.front();
				main.pop();
				while(main.empty() == 0) {
					ans *= main.front();
					main.pop();
				}
				main.push(ans);
			}else {
				int ans = temp.front();
				temp.pop();
				while(temp.empty() == 0) {
					ans *= temp.front();
					temp.pop();
				}
				main.push(ans);
			}
		}else {
			temp.push(stoi(s));
		}
	}

	cout << main.front() << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:20: error: 'strcmp' was not declared in this scope
   32 |                 if(strcmp(s,"+") == 0) {
      |                    ^~~~~~
a.cc:9:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <sstream>
  +++ |+#include <cstring>
    9 | 
a.cc:87:39: error: call of overloaded 'stoi(char [16])' is ambiguous
   87 |                         temp.push(stoi(s));
      |                                   ~~~~^~~
a.cc:12:5: note: candidate: 'int stoi(std::string)'
   12 | int stoi (string 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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++

//逆ポーランド記法
#include<stdio.h>
#include<string.h>

#define STACK_SIZE 100
#define TRUE 1
#define FALSE 0
#define N 300

int stack[STACK_SIZE];
int top=0;

int isEmpty(){
  if(stack[top]==0){
    return TRUE;
      }else{
    return FALSE;
      }
}

void push(int a){
  top++;
  stack[top]=a;
}

int pop(){
  if(isEmpty()==TRUE){
    printf("error underflow\n");
  }else{
    return stack[top--];
  }
}

int main(){
  int i;
  int c=0;
  int a=0,b=0;
  char input[N];
  char str[10];
  int num;
  int pop1,pop2;

  while(scanf("%c",&input[c])!=EOF){
    c++;
  }
  for(i=0;i<c;i++){

      if(input[i]==' '){
	b=i;
	if('0'<=input[i-1] && input[i-1]<='9'){
	  strncpy(str,input+a,b-a);
	  str[b-a]='\0';
	  num=atoi(str);
	  push(num);
	}
	a=b+1;
      }else if(input[i]=='+'){
	pop2=pop();
	pop1=pop();
	push(pop1+pop2);
      }else if(input[i]=='-'){
	pop2=pop();
	pop1=pop();
	push(pop1-pop2);
      }else if(input[i]=='*'){
	pop2=pop();
	pop1=pop();
	push(pop1*pop2);
      }else{
	continue;
      }
  }


  printf("%d\n",pop());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:15: error: 'atoi' was not declared in this scope
   53 |           num=atoi(str);
      |               ^~~~
a.cc: In function 'int pop()':
a.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^
Language: C++

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

int main(){
	stack<int> intStack;
	char c;
	
	while(scanf("%c",&c)){
		
		if(c=='+'||c=='-'||c=='*'){
			int in,a,b;
			b=intStack.top();
			intStack.pop();
			a=intStack.top();
			intStack.pop();
			switch (c){
				case '+':	in=a+b;break;
				case '-':	in=a-b;break;
				case '*':	in=a/b;break;
				default: break;
			}
			intStack.push(in);
		}else{
			int a;
			a=atoi(c);
			intStack.push(a);
		}
		
	}
	cout<<c<<endl;
	cout<<intStack.top()<<endl;
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   28 |                         a=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>
using namespace std;

int cul( m1, m2, m0 ) {
	int ret;
	if ( m0 == '+' ) ret = m1 + m2;
	if ( m0 == '-' ) ret = m1 - m2;
	if ( m0 == '*' ) ret = m1 * m2;
	return ret;
}

int main() {
	stack<int> s;
	int m0, m1, m2;
	for ( int i = 0; i < 99; i++ ) {
		while (1) {
			cin >> m0;
			if ( m0 == '+' || m0 == '-' || m0 == '*' ) {
				m2 = s.top();
				s.pop();
				m1 = s.top();
				s.pop();
				s.push( cul( m1, m2, m0 ) );
				break;
			} else
				s.push( m0 );
		}
	}
	cout << s.top() << endl;
}

Compiler output:
a.cc:5:10: error: 'm1' was not declared in this scope
    5 | int cul( m1, m2, m0 ) {
      |          ^~
a.cc:5:14: error: 'm2' was not declared in this scope
    5 | int cul( m1, m2, m0 ) {
      |              ^~
a.cc:5:18: error: 'm0' was not declared in this scope
    5 | int cul( m1, m2, m0 ) {
      |                  ^~
a.cc:5:21: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | int cul( m1, m2, m0 ) {
      |                     ^
a.cc: In function 'int main()':
a.cc:24:44: error: 'cul' cannot be used as a function
   24 |                                 s.push( cul( m1, m2, m0 ) );
      |                                         ~~~^~~~~~~~~~~~~~
Language: C++

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

int cul( n1, n2, n0 ) {
	int ret;
	if ( n0 == '+' ) ret = n1 + n2;
	if ( n0 == '-' ) ret = n1 - n2;
	if ( n0 == '*' ) ret = n1 * n2;
	return ret;
}

int main() {
	stack<int> s;
	int m0, m1, m2;
	for ( int i = 0; i < 99; i++ ) {
		while (1) {
			cin >> m0;
			if ( m0 == '+' || m0 == '-' || m0 == '*' ) {
				m2 = s.top();
				s.pop();
				m1 = s.top();
				s.pop();
				s.push( cul( m1, m2, m0 ) );
				break;
			} else
				s.push( m0 );
		}
	}
	cout << s.top() << endl;
}

Compiler output:
a.cc:5:10: error: 'n1' was not declared in this scope
    5 | int cul( n1, n2, n0 ) {
      |          ^~
a.cc:5:14: error: 'n2' was not declared in this scope
    5 | int cul( n1, n2, n0 ) {
      |              ^~
a.cc:5:18: error: 'n0' was not declared in this scope
    5 | int cul( n1, n2, n0 ) {
      |                  ^~
a.cc:5:21: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | int cul( n1, n2, n0 ) {
      |                     ^
a.cc: In function 'int main()':
a.cc:24:44: error: 'cul' cannot be used as a function
   24 |                                 s.push( cul( m1, m2, m0 ) );
      |                                         ~~~^~~~~~~~~~~~~~
Language: C++

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

int cul( int n1, int n2, string ss ) {
	int ret;
	if ( ss == "+" ) ret = n1 + n2;
	if ( ss == "-" ) ret = n1 - n2;
	if ( ss == "*" ) ret = n1 * n2;
	return ret;
}

int main() {
	stack<int> s;
	string st;
	int m1, m2;
	while ( cin >> st ) {
		if ( st == "+" || st == "-" || st == "*" ) {
			m2 = s.top();
			s.pop();
			m1 = s.top();
			s.pop();
			s.push( cul( m1, m2, st ) );
		} else {
			s.push( (int)st );
		}
	}
	cout << s.top() << endl;
}

Compiler output:
a.cc:3:18: warning: extra tokens at end of #include directive
    3 | #include <string>;
      |                  ^
a.cc: In function 'int main()':
a.cc:26:33: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   26 |                         s.push( (int)st );
      |                                 ^~~~~~~
Language: C++


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <ctime>
#include <stack>
#include <string>

using namespace std;

int main(void){
	string word;
	stack<int> S;

	while(cin >> word){
		if(word == "+"){
			int a, b;
			a = S.top();
			S.pop();
			b = S.top();
			S.pop();
			S.push(a + b);
		}else if(word == "-"){
			int a, b;
			a = S.top();
			S.pop();
			b = S.top();
			S.pop();
			S.push(a - b);
		}else if(word == "*"){
			int a, b;
			a = S.top();
			S.pop();
			b = S.top();
			S.pop();
			S.push(a * b);
		}else{
			S.push(atoi(word));
		}
	}
	int ans = S.top();
	cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   41 |                         S.push(atoi(word));
      |                                     ^~~~
      |                                     |
      |                                     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:3:
/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 <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_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("%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: In function 'int pop()':
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
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_s(op, "%d", &x); push(x);
			}
			j = 0;
		}
	}
	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:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |         gets(str);
      |         ^~~~
      |         getw
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: In function 'int pop()':
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
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_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 | }
      | ^