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

#include<stdio.h>
#include<string.h>
#include<stack>
using namespace std;
stack<int> s1;
stack<char> s2;

int main(){
	char ch[300];
	gets(ch);
	int len=strlen(ch);
	int num=0;
	int m=10;
	for(int i=0;i<len;i++){
		if(ch[i]>='0'&&ch[i]<='9'){
			if(num==0){
				num=ch[i]-'0';
			}else if(num/m==0){
				num=m*num+(ch[i]-'0');
				m*=10;
			}
			continue;
		}
		
		if(num!=0){
			s1.push(num);	
			num=0;
			m=10;
		}
		if(ch[i]=='+'||ch[i]=='-'||ch[i]=='/'||ch[i]=='*'){
			s2.push(ch[i]);
		}
		if(s1.size()>=2&&s2.size()==1){
			int num1=s1.top();s1.pop();
			int num2=s1.top();s1.pop();
			char op=s2.top();s2.pop();
			int ans;
			switch(op){
				case '+':ans=num1+num2;s1.push(ans);break;
				case '-':ans=num2-num1;s1.push(ans);break;
				case '*':ans=num1*num2;s1.push(ans);break;
				case '/':ans=num2/num1;s1.push(ans);break;
			}
		}
	}
	
	int res=s1.top();
	printf("%d\n",res);
	
	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(ch);
      |         ^~~~
      |         getw
Language: C++

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

int main(){
    int a, b;
    stack<int> st;
    string s;
    getline(cin,s);
    stringstream ss;
    ss << s;
    while( ss >> s ) { // 1 2 -
        if(s=="+"){
            a = st.pop();
            b = st.pop();
            st.push(a+b);
        }else if(s=="-"){
            a = st.pop();
            b = st.pop();
            st.push(b-a);
        }else if(s=="*"){
            a = st.pop();
            b - st.pop();
            st.push(a*b);
        }else{
            st.push(atoi(s.c_str()));
        }
    }
    a = st.pop();
    cout << a << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: void value not ignored as it ought to be
   16 |             a = st.pop();
      |                 ~~~~~~^~
a.cc:17:23: error: void value not ignored as it ought to be
   17 |             b = st.pop();
      |                 ~~~~~~^~
a.cc:20:23: error: void value not ignored as it ought to be
   20 |             a = st.pop();
      |                 ~~~~~~^~
a.cc:21:23: error: void value not ignored as it ought to be
   21 |             b = st.pop();
      |                 ~~~~~~^~
a.cc:24:23: error: void value not ignored as it ought to be
   24 |             a = st.pop();
      |                 ~~~~~~^~
a.cc:25:15: error: invalid operands of types 'int' and 'void' to binary 'operator-'
   25 |             b - st.pop();
      |             ~ ^ ~~~~~~~~
      |             |         |
      |             int       void
a.cc:31:15: error: void value not ignored as it ought to be
   31 |     a = st.pop();
      |         ~~~~~~^~
Language: C++

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

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

    while(cin>>s){
        cout << s[0] << endl;
        if (s[0] == '+'){
            a = S.top(); S.pop();
            b = S.top(); S.pop();
            S.push(a+b);
        }else if(s[0] == '-'){
            b = S.top(); S.pop();
            a = S.top(); S.pop();
            S.push(a-b);
        }else if(s[0] == '*'){
            a = S.top(); S.pop();
            b = S.top(); S.pop();
            S.push(a*b);
        }else{
            S.push(atoi(s.c_str()));
        }
    }
    cout << S.top() << endl;
    return 0;
}



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

class Stack:
    def __init__(self, n):
        self.n = n
        self._l = [None for _ in range(self.n + 1)]
        self._top = 0

    def push(self, x):
        if self.isFull():
            raise IndexError("stack is full")
        else:
            self._top += 1
            self._l[self._top] = x

    def pop(self):
        if self.isEmpty():
            raise IndexError("pop from empty stack")
        else:
            e = self._l[self._top]
            self._l[self._top] = None
            self._top -= 1
            return e

    def isEmpty(self):
        return self._top == 0

    def isFull(self):
        return self._top == self.n

def poland_calculator(s):
    n = len(s)
    stack = Stack(n)
    i = 0
    while i < n:
        if s[i] == ' ':
            i += 1
            continue
        elif s[i].isdigit():
            sn = ''
            while s[i].isdigit():
                sn += s[i]
                i += 1
            stack.push(int(sn))
        else:
            b = stack.pop()
            a = stack.pop()
            if s[i] == '+':
                e = a + b
            elif s[i] == '-':
                e = a - b
            else:
                e = a * b
            stack.push(e)
            i +=1

    return stack.pop()


if __name__ == '__main__':
    s = input()
    res = poland_calculator(s)
    print(res)



Compiler output:
a.cc:38:18: error: empty character constant
   38 |             sn = ''
      |                  ^~
a.cc:58:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   58 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:9: error: expected class-name before '__init__'
    2 |     def __init__(self, n):
      |         ^~~~~~~~
a.cc:2:9: error: expected '{' before '__init__'
a.cc:2:18: error: 'self' was not declared in this scope
    2 |     def __init__(self, n):
      |                  ^~~~
a.cc:2:24: error: 'n' was not declared in this scope
    2 |     def __init__(self, n):
      |                        ^
a.cc:2:25: error: expression list treated as compound expression in initializer [-fpermissive]
    2 |     def __init__(self, n):
      |                         ^
Language: C++

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

int top, S[1000];

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

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

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

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: expected primary-expression before ')' token
   22 |     if ( s[0] == '+') ) {
      |                       ^
a.cc:35:20: error: expected ';' before '}' token
   35 |       push(atoi(s))
      |                    ^
      |                    ;
   36 |     }
      |     ~
Language: C++

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

int top, S[1000];

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

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

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

  return 0;
}


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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
map <int ,int> mpa,mpb;

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]=='+'){
      b=pop();
      a=pop();
      push(a+b);
    }
    else if(s[0]=='-'){
      b=pop();
      a=pop();
      push(a-b);
    }
    else if(s[0]=='*'){
      b=pop();
      a=pop();
      push(a*b);
    }
    else{
      push(atoi(s[0]));
    }
  }
  printf("%d\n", pop());
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   46 |       push(atoi(s[0]));
      |                 ~~~^
      |                    |
      |                    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<sstream>
using namespace std;

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

int main(){
  Stack p;
  string e;
  getline(cin, e);
  istringstream is(e);
  while(!is.eof()){
    string op;
    is >> op;
    int tmp1,tmp2;
    switch(op[0]){
      case'+':
        tmp1 = p.top();
        p.pop();
        tmp2 = p.top();
        p.pop();
        p.push(tmp2+tmp1);
        break;
      case'-':
        tmp1 = p.top();
        p.pop();
        tmp2 = p.top();
        p.pop();
        p.push(tmp2-tmp1);
        break;
      case'*':
        tmp1 = p.top();
        s.pop();
        tmp2 = p.top();
        p.pop();
        p.push(tmp2*tmp1);
        break;
      default:
        istringstream is2(op);
        is2 >> tmp1;
        p.push(tmp1);
        break;
    }
  }
  cout << p.top() << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:66:9: error: 's' was not declared in this scope; did you mean 'is'?
   66 |         s.pop();
      |         ^
      |         is
Language: C++

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

int top, S[1000];

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: expected primary-expression before '=' token
   21 |     while (scanf("%s", s) !== EOF) {
      |                             ^
Language: C++

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

stack<int> S;

int 

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


Compiler output:
a.cc:8:1: error: two or more data types in declaration of 'main'
    8 | int
      | ^~~
Language: C++

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

stack<int> S;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 's' was not declared in this scope
   10 |     while (scanf("%s", s) != EOF) {
      |                        ^
a.cc:12:22: error: void value not ignored as it ought to be
   12 |             a = S.pop();
      |                 ~~~~~^~
a.cc:13:22: error: void value not ignored as it ought to be
   13 |             b = S.pop();
      |                 ~~~~~^~
a.cc:16:22: error: void value not ignored as it ought to be
   16 |             b = S.pop();
      |                 ~~~~~^~
a.cc:17:22: error: void value not ignored as it ought to be
   17 |             a = S.pop();
      |                 ~~~~~^~
a.cc:20:22: error: void value not ignored as it ought to be
   20 |             a = S.pop();
      |                 ~~~~~^~
a.cc:21:22: error: void value not ignored as it ought to be
   21 |             b = S.pop();
      |                 ~~~~~^~
a.cc:28:23: error: invalid use of void expression
   28 |     printf("%d", S.pop());
      |                  ~~~~~^~
Language: C++

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

stack<int> S;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: void value not ignored as it ought to be
   14 |             a = S.pop();
      |                 ~~~~~^~
a.cc:15:22: error: void value not ignored as it ought to be
   15 |             b = S.pop();
      |                 ~~~~~^~
a.cc:18:22: error: void value not ignored as it ought to be
   18 |             b = S.pop();
      |                 ~~~~~^~
a.cc:19:22: error: void value not ignored as it ought to be
   19 |             a = S.pop();
      |                 ~~~~~^~
a.cc:22:22: error: void value not ignored as it ought to be
   22 |             a = S.pop();
      |                 ~~~~~^~
a.cc:23:22: error: void value not ignored as it ought to be
   23 |             b = S.pop();
      |                 ~~~~~^~
a.cc:30:23: error: invalid use of void expression
   30 |     printf("%d", S.pop());
      |                  ~~~~~^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:29:23: error: invalid use of void expression
   29 |     printf("%d", S.pop());
      |                  ~~~~~^~
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

struct Stack{
    Stack(){
        top = 0;
    }

    int top;
    int MAX = 1000;
    int v[MAX];

    bool is_Empty(){
        if (top == 0) return true;
        else return false;
    }
    bool is_Full(){
        if (top >= MAX-1) return true;
        else return false;
    }
    void push(int x){
        if(is_Full())return;
        else {
            top++;
            v[top] = x;
        }
    }
    int pop(){
        if(is_Empty())return 0;
        else {
            top--;
            return v[top+1];
        }
    }
}

int calc(int x,string op,int y){
  if(op=="+")return x+y;
  if(op=="-")return x-y;
  if(op=="*")return x*y;
  else return 0;
}


signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    Stack s;

    int res = 0;
    int numA, numB;
    string str;
    while(cin >> str){

        if(str=="+"||str=="-"||str=="*"){
            numA=s.pop();
            numB=s.pop();
            s.push(calc(numB,str,numA));
        }else{
            numA=0;

            for(int i=0;i<(int)str.size();i++){
                numA*=10;
                numA+=str[i]-'0';
            }

        s.push(numA);
        }
    }

  cout<<s.pop()<<endl;
     
}


Compiler output:
a.cc:32:11: error: invalid use of non-static data member 'Stack::MAX'
   32 |     int v[MAX];
      |           ^~~
a.cc:31:9: note: declared here
   31 |     int MAX = 1000;
      |         ^~~
a.cc:56:2: error: expected ';' after struct definition
   56 | }
      |  ^
      |  ;
a.cc: In member function 'void Stack::push(int)':
a.cc:46:13: error: 'v' was not declared in this scope
   46 |             v[top] = x;
      |             ^
a.cc: In member function 'int Stack::pop()':
a.cc:53:20: error: 'v' was not declared in this scope
   53 |             return v[top+1];
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

struct Stack{
    Stack(){
        top = 0;
    }

    int top;
    int MAX = 1000;
    int v[MAX];

    bool is_Empty(){
        if (top == 0) return true;
        else return false;
    }
    bool is_Full(){
        if (top >= MAX-1) return true;
        else return false;
    }
    void push(int x){
        if(is_Full())return;
        else {
            top++;
            v[top] = x;
        }
    }
    int pop(){
        if(is_Empty())return 0;
        else {
            top--;
            return v[top+1];
        }
    }
};

int calc(int x,string op,int y){
  if(op=="+")return x+y;
  if(op=="-")return x-y;
  if(op=="*")return x*y;
  else return 0;
}


signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    Stack s;

    int res = 0;
    int numA, numB;
    string str;
    while(cin >> str){

        if(str=="+"||str=="-"||str=="*"){
            numA=s.pop();
            numB=s.pop();
            s.push(calc(numB,str,numA));
        }else{
            numA=0;

            for(int i=0;i<(int)str.size();i++){
                numA*=10;
                numA+=str[i]-'0';
            }

        s.push(numA);
        }
    }

  cout<<s.pop()<<endl;
     
}


Compiler output:
a.cc:32:11: error: invalid use of non-static data member 'Stack::MAX'
   32 |     int v[MAX];
      |           ^~~
a.cc:31:9: note: declared here
   31 |     int MAX = 1000;
      |         ^~~
a.cc: In member function 'void Stack::push(int)':
a.cc:46:13: error: 'v' was not declared in this scope
   46 |             v[top] = x;
      |             ^
a.cc: In member function 'int Stack::pop()':
a.cc:53:20: error: 'v' was not declared in this scope
   53 |             return v[top+1];
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

struct Stack{
    Stack(){
        top = 0;
    }

    int top;
    static int byFull = 1000;
    int v[byFull];

    bool is_Empty(){
        if (top == 0) return true;
        else return false;
    }
    bool is_Full(){
        if (top >= byFull-1) return true;
        else return false;
    }
    void push(int x){
        if(is_Full())return;
        else {
            top++;
            v[top] = x;
        }
    }
    int pop(){
        if(is_Empty())return 0;
        else {
            top--;
            return v[top+1];
        }
    }
};

int calc(int x,string op,int y){
  if(op=="+")return x+y;
  if(op=="-")return x-y;
  if(op=="*")return x*y;
  else return 0;
}


signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    Stack s;

    int numA, numB;
    string str;
    while(cin >> str){

        if(str=="+"||str=="-"||str=="*"){
            numA=s.pop();
            numB=s.pop();
            s.push(calc(numB,str,numA));
        }else{
            numA=0;

            for(int i=0;i<(int)str.size();i++){
                numA*=10;
                numA+=str[i]-'0';
            }

        s.push(numA);
        }
    }

  cout<<s.pop()<<endl;
     
}


Compiler output:
a.cc:31:16: error: ISO C++ forbids in-class initialization of non-const static member 'Stack::byFull'
   31 |     static int byFull = 1000;
      |                ^~~~~~
a.cc:32:11: error: size of array 'v' is not an integral constant-expression
   32 |     int v[byFull];
      |           ^~~~~~
Language: C++

#include <stdio.h>
#include <string.h>
int pop();
void push(int );
int x[1000],top;
int main(){
  top=0;
  char c[100];
  int a,b;
  while(scanf("%s",c)!=EOF){
    if(c[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(c[0]=='-'){
      b=pop();
      a=pop();   
      push(a-b);
    }
    else if(c[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else{
      push(atoi(c));
    }
  }
  printf("%d\n",pop());
  return 0;
}
void push(int a){
  x[++top]=a;
}
int pop(){
  return x[top--];
}



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

#include <stdio.h>
#include <stdlib.h>
int pop();
void push(int );
int x[1000],top;
int main(){
  top=0;
  char c[100];
  int a,b;
  while(scanf("%s",c)!=EOF){
    if(c[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(c[0]=='-'){
      b=pop();
      a=pop();   
      push(a-b);
    }
    else if(c[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else{
      push(atoi(c));
    }
  }
  printf("%d\n",pop());
  return 0;
}
void push(int a){
  x[++top]=a;
}gcc 
int pop(){
  return x[top--];
}



Compiler output:
a.cc:35:2: error: 'gcc' does not name a type
   35 | }gcc
      |  ^~~
Language: C++

#include <stdio.h>
 
void insert(int);
void delete(int);
void deleteFirst(void);
void deleteLast(void);
 
int data[2000000];
int m=0;
 
int main(){
 
int n,i,x;
char com[20];
 
scanf("%d",&n);
 
for(i=0 ; i<n ; i++){
  data[i]=0;
}
 
for(i=0 ; i<n ; i++){
  scanf("%s",com);
  if(com[0]=='i') {
    scanf("%d",&x);
    insert(x);
  }
  else if(com[6]=='F') deleteFirst();
  else if(com[6]=='L') deleteLast();
  else {
    scanf("%d",&x);
    delete(x);
  }
}
 
for(i=0 ; i<m ; i++){
  if(i=m-1) printf("%d\n",data[i]);
  printf("%d ",data[i]);
}
 
  return 0;
 
}
 
 
void insert(int x){
int i,temp;
 
for(i=m ; i>=0 ; i--){
  data[i+1]=data[i];
  if(i==0)data[i]=x;
  }
  m++;
}
 
void delete(int x){
  int i,j;
  for(i=0 ; i<m ; i++){
    if(data[i]==x){
      for(j=i ; j<m-1 ; j++){
        data[j]=data[j+1];
      }
      data[m]=0;
      m--;
      break;
    }
  }
}
 
void deleteFirst(){
  int i;
 
  for(i=0 ; i<m-1 ; i++){
    data[i]=data[i+1];
  }
 
  m--;
 
}
 
void deleteLast(){
 
  data[m]=0;
 
  m--;
}



Compiler output:
a.cc:4:6: error: expected unqualified-id before 'delete'
    4 | void delete(int);
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:32:12: error: type 'int' argument given to 'delete', expected pointer
   32 |     delete(x);
      |           ~^~
a.cc: At global scope:
a.cc:56:6: error: expected unqualified-id before 'delete'
   56 | void delete(int x){
      |      ^~~~~~
Language: C++

include <stdio.h>
#include <stdlib.h>
#define STACK_MAX  20     
#define STACK_OK   0x8000     
#define STACK_FULL STACK_OK + 1   
#define STACK_END  STACK_OK + 2   

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

int     stack[STACK_MAX];  
int     stack_pointer = 0;  

int main(void)
{
  char A[100];
  int i;

  for(i=0;scanf("%s",A[i];)!=EOF;i++);

  printf("output:%d\n",res(data));
  return 0;
}

int res(char A[]){
  int i=0,x=0,y=0;
  for(i=0;A[i] != '\0';i++){
     switch(A[i]){
        case '+':
            x = pop();
            y = pop();
            push(x+y);
            break;

        case '-':
            x = pop();
            y = pop();
            push(x-y);
            break;
              default :
            push(data[i]);
            break;
        }
    }
  return pop();
}

int push(int d)
{
  if(stack_pointer >= STACK_MAX)  
    return(STACK_FULL);         
  stack[stack_pointer] = d;      

  ++stack_pointer;               
  return(STACK_OK);             
}

int pop(void)
{
  if(stack_pointer == 0)       
      return(STACK_END);        

  --stack_pointer;                
  return(stack[stack_pointer]);   
}
  


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:19:26: error: expected ')' before ';' token
   19 |   for(i=0;scanf("%s",A[i];)!=EOF;i++);
      |                ~         ^
      |                          )
a.cc:19:28: error: expected primary-expression before '!=' token
   19 |   for(i=0;scanf("%s",A[i];)!=EOF;i++);
      |                            ^~
a.cc:19:30: error: 'EOF' was not declared in this scope
   19 |   for(i=0;scanf("%s",A[i];)!=EOF;i++);
      |                              ^~~
a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <stdlib.h>
  +++ |+#include <cstdio>
    3 | #define STACK_MAX  20
a.cc:19:37: error: expected ';' before ')' token
   19 |   for(i=0;scanf("%s",A[i];)!=EOF;i++);
      |                                     ^
      |                                     ;
a.cc:21:28: error: 'data' was not declared in this scope
   21 |   printf("output:%d\n",res(data));
      |                            ^~~~
a.cc:21:24: error: 'res' was not declared in this scope
   21 |   printf("output:%d\n",res(data));
      |                        ^~~
a.cc:21:3: error: 'printf' was not declared in this scope
   21 |   printf("output:%d\n",res(data));
      |   ^~~~~~
a.cc:21:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc: In function 'int res(char*)':
a.cc:41:18: error: 'data' was not declared in this scope
   41 |             push(data[i]);
      |                  ^~~~
Language: C++

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

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

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

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

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

    
return 0;
}



Compiler output:
a.cc: In function 'void push(int)':
a.cc:2:5: error: 'S' was not declared in this scope
    2 |     S[++top] = x;
      |     ^
a.cc:2:9: error: 'top' was not declared in this scope
    2 |     S[++top] = x;
      |         ^~~
a.cc: In function 'int pop()':
a.cc:6:5: error: 'top' was not declared in this scope; did you mean 'pop'?
    6 |     top--;
      |     ^~~
      |     pop
a.cc:7:12: error: 'S' was not declared in this scope
    7 |     return S[top+1];
      |            ^
a.cc: In function 'int main()':
a.cc:12:5: error: 'top' was not declared in this scope; did you mean 'pop'?
   12 |     top = 0;
      |     ^~~
      |     pop
a.cc:15:12: error: 'scanf' was not declared in this scope
   15 |     while( scanf("%s", s) != EOF ){
      |            ^~~~~
a.cc:15:30: error: 'EOF' was not declared in this scope
   15 |     while( scanf("%s", s) != EOF ){
      |                              ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void push(int x){
a.cc:29:18: error: 'atoi' was not declared in this scope
   29 |             push(atoi(s));
      |                  ^~~~
a.cc:33:5: error: 'printf' was not declared in this scope
   33 |     printf("%d\n", pop());
      |     ^~~~~~
a.cc:33:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

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

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

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

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

    return 0;
}



Compiler output:
a.cc: In function 'void push(int)':
a.cc:2:5: error: 'S' was not declared in this scope
    2 |     S[++top] = x;
      |     ^
a.cc:2:9: error: 'top' was not declared in this scope
    2 |     S[++top] = x;
      |         ^~~
a.cc: In function 'int pop()':
a.cc:6:5: error: 'top' was not declared in this scope; did you mean 'pop'?
    6 |     top--;
      |     ^~~
      |     pop
a.cc:7:12: error: 'S' was not declared in this scope
    7 |     return S[top+1];
      |            ^
a.cc: In function 'int main()':
a.cc:12:5: error: 'top' was not declared in this scope; did you mean 'pop'?
   12 |     top = 0;
      |     ^~~
      |     pop
a.cc:15:12: error: 'scanf' was not declared in this scope
   15 |     while( scanf("%s", s) != EOF ){
      |            ^~~~~
a.cc:15:30: error: 'EOF' was not declared in this scope
   15 |     while( scanf("%s", s) != EOF ){
      |                              ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void push(int x){
a.cc:29:18: error: 'atoi' was not declared in this scope
   29 |             push(atoi(s));
      |                  ^~~~
a.cc:33:5: error: 'printf' was not declared in this scope
   33 |     printf("%d\n", pop());
      |     ^~~~~~
a.cc:33:5: 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>

int top,S[1000];

void push(int x){
	top++;
	S[top]=x;
	/*S[++top]となる
	S[top++]はだめ*/
}
	int pop(){
		top--;
		return[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);
	}if(s[0]=="-"){
			b=pop();
			a=pop();
			push(a-b);
}if(s[0]=="*"){
			a=pop();
			b=pop();
			push(a:b);
}}
		printf("%d\n",pop());
		return 0:
	}


Compiler output:
a.cc: In function 'int pop()':
a.cc:15:24: warning: capture of variable 'top' with non-automatic storage duration
   15 |                 return[top+1];
      |                        ^~~
a.cc:5:5: note: 'int top' declared here
    5 | int top,S[1000];
      |     ^~~
a.cc:15:27: error: expected ',' before '+' token
   15 |                 return[top+1];
      |                           ^
      |                           ,
a.cc:15:27: error: expected identifier before '+' token
a.cc: In lambda function:
a.cc:15:30: error: expected '{' before ';' token
   15 |                 return[top+1];
      |                              ^
a.cc: In function 'int pop()':
a.cc:15:23: error: invalid user-defined conversion from 'pop()::<lambda()>' to 'int' [-fpermissive]
   15 |                 return[top+1];
      |                       ^~~~~~~
a.cc:15:23: note: candidate is: 'constexpr pop()::<lambda()>::operator void (*)()() const' (near match)
   15 |                 return[top+1];
      |                       ^
a.cc:15:23: note:   no known conversion from 'void (*)()' to 'int'
a.cc: In function 'int main()':
a.cc:18:16: error: found ':' in nested-name-specifier, expected '::'
   18 |         int a,b:
      |                ^
      |                ::
a.cc:18:15: error: 'b' has not been declared
   18 |         int a,b:
      |               ^
a.cc:19:12: error: qualified-id in declaration before '=' token
   19 |         top=0
      |            ^
a.cc:22:26: error: 's' was not declared in this scope
   22 |         while(scanf("%s",s) !=EOF){
      |                          ^
a.cc:25:25: error: 'b' was not declared in this scope
   25 |                         b=pop();
      |                         ^
a.cc:28:25: error: 'b' was not declared in this scope
   28 |                         b=pop();
      |                         ^
a.cc:33:25: error: 'b' was not declared in this scope
   33 |                         b=pop();
      |                         ^
a.cc:34:31: error: found ':' in nested-name-specifier, expected '::'
   34 |                         push(a:b);
      |                               ^
      |                               ::
a.cc:34:30: error: 'a' is not a class, namespace, or enumeration
   34 |                         push(a:b);
      |                              ^
a.cc:37:25: error: expected ';' before ':' token
   37 |                 return 0:
      |                         ^
      |                         ;
a.cc:37:25: error: expected primary-expression before ':' token
Language: C++

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

int S[3];
int top = 0;

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

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

int main() {
  char c;
  int a, b;
  while(cin >> c){
    if (c=="+") {
      a = pop();
      b = pop();
      push(a+b);
    } else if (c=="-") {
      a = pop();
      b = pop();
      push(a-b);
    } else if (c=="*") {
      a = pop();
      b = pop();
      push(a*b);
    } else {
      push(int(c));
    }
  }
  cout << pop() << endl;;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |     if (c=="+") {
      |         ~^~~~~
a.cc:26:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |     } else if (c=="-") {
      |                ~^~~~~
a.cc:30:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |     } else if (c=="*") {
      |                ~^~~~~
Language: C++

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

int S[3];
int top = 0;

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

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

int main() {
  string c;
  int a, b;
  while(cin >> c){
    if (c=="+") {
      a = pop();
      b = pop();
      push(a+b);
    } else if (c=="-") {
      a = pop();
      b = pop();
      push(a-b);
    } else if (c=="*") {
      a = pop();
      b = pop();
      push(a*b);
    } else {
      push(atoi(c));
    }
  }
  cout << pop() << endl;;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   35 |       push(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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int S[200];
int top = 0;

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

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

int main() {
  string s;
  char c;
  int a, b;
  cin >> s;
  int i=0;
  while(c = s[i]){
    if (c=='+') {
      a = pop();
      b = pop();
      push(a+b);
    } else if (c=='-') {
      a = pop();
      b = pop();
      push(a-b);
    } else if (c=='*') {
      a = pop();
      b = pop();
      push(a*b);
    } else {
      push(stoi(c));
    }
  }
  cout << pop() << endl;;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:16: error: no matching function for call to 'stoi(char&)'
   37 |       push(stoi(c));
      |            ~~~~^~~
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)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'char' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'char' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int S[200];
int top = 0;

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

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

int main() {
  string s;
  char c;
  int a, b;
  cin >> s;
  int i=0;
  while(c = s[i]){
    if (c=='+') {
      a = pop();
      b = pop();
      push(a+b);
    } else if (c=='-') {
      a = pop();
      b = pop();
      push(a-b);
    } else if (c=='*') {
      a = pop();
      b = pop();
      push(a*b);
    } else {
      push(atoi(c));
    }
  }
  cout << pop() << endl;;
  return 0;
}


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

int S[200];
int top = 0;

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

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

int main() {
  string c;
  int a, b;
  while(cin >> c){
    if (c=="+") {
      a = pop();
      b = pop();
      push(a+b);
    } else if (c=="-") {
      b = pop();
      a = pop();
      push(a-b);
    } else if (c=="*") {
      a = pop();
      b = pop();
      push(a*b);
    } else {
      push(atoi(c));
    }
  }
  cout << pop() << endl;;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   35 |       push(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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<stdlib.h>
using namespace std;
const int Max=300;
int Stack[Max];
int top=0;
bool isFull()
{
    return (top>=Max);
       
}
bool isEmpty(){
    return top==0;
}
int push(int x){
    if (!isFull){
        Stack[top++]=x;
    }
    
}
 
 int pop(){
     if(!isEmpty)
     return Stack[--top];
 }
 
 int main(){
     
     int a,b;
     char c;
     top=0;
     while(cin>>c){
         if(c=='+'){
             a=pop();
             b=pop();
             push(a+b);
         }
         else if(c=='-'){
              a=pop();
             b=pop();
             push(a-b);
         }
         else if(c=='*'){
               a=pop();
             b=pop();
             push(a*b);
         }
         else push(atoi(c));
     }
     cout<<Stack[--top];
     return 0;
 }


Compiler output:
a.cc: In function 'int push(int)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:48:25: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   48 |          else 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)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc: In function 'int pop()':
a.cc:25:2: warning: control reaches end of non-void function [-Wreturn-type]
   25 |  }
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
stack<int> s;
char op[3333];
int main(){
    gets(op);
    int len = strlen(op);
    int n = 0;
    for(int i = 0; i < len; i++){
        if(op[i] >= '0' && op[i] <= '9'){
            n = n*10 + (op[i]-'0');
        }
        else if(op[i] == ' ' && op[i-1] >= '0' && op[i-1] <= '9'){
            s.push(n);
            n = 0;
        }
        else if(op[i] == '+' || op[i] == '-' || op[i] == '*' || op[i] == '/'){
            int y = s.top();
            s.pop();
            int x = s.top();
            s.pop();
            if(op[i] == '+'){
                s.push(x+y);
            }
            else if(op[i] == '-'){
                s.push(x-y);
            }
            else if(op[i] == '*'){
                s.push(x*y);
            }
            else if(op[i] == '/'){
                s.push(x/y);
            }
        }
    }
    cout << s.top();
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(op);
      |     ^~~~
      |     getw