criyle/codenet-compile-errors huggingface dataset:
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];   /* スタック領域 [0] - [19] */
int     stack_pointer = 0;  /* スタックポインタ */
 
int main(void)
{
    char s[100]; 
    printf("逆ポーランド記法で書かれた数式を計算します。\n");
    printf("input:");
    scanf("%s",data);
    printf("output:%d\n",res(data));
    return 0;
}
int res(char data[]){
    int i=0,x=0,y=0;
    for(i=0;s[i] != '\0';i++){
        switch(s[i]){
            case '+':
                x = pop();
                y = pop();
                push(x+y);
                break;
            case '-':
                x = pop();
                y = pop();
                push(x-y);
                break;
            case '/':
                x = pop();
                y = pop();
                push(y/x);
                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_FULLを返す */
    stack[stack_pointer] = d;       /* スタックにデータ格納 */
    ++stack_pointer;                /* スタックポインタに1加算 */
    return(STACK_OK);               /* STACK_OKを返す */
}
int pop(void)
{
    if(stack_pointer == 0)          /* スタックポインタが0 */
        return(STACK_END);          /* STACK_ENDを返す */
    --stack_pointer;                /* スタックポインタから1減算 */
    return(stack[stack_pointer]);   /* スタックのデータを返す */
}

Compiler output:
main.c: In function 'main':
main.c:19:16: error: 'data' undeclared (first use in this function)
   19 |     scanf("%s",data);
      |                ^~~~
main.c:19:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:26: error: implicit declaration of function 'res' [-Wimplicit-function-declaration]
   20 |     printf("output:%d\n",res(data));
      |                          ^~~
main.c: In function 'res':
main.c:25:13: error: 's' undeclared (first use in this function)
   25 |     for(i=0;s[i] != '\0';i++){
      |             ^
Language: C

#include<stdlib.h>
#include<string.h>
#define MAX 100
int main(){
  int x=0,y=0,i=0;
  char s[MAX];
  int sgym[MAX];
  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      i -= 1;
      x = sgym[i];
      i -= 1;
      y = sgym[i];
      i += 1;
      sgym[i] = x + y;
     } else if ( s[0] == '-' ){
      i -= 1;
      x = sgym[i];
      i -= 1;
      y = sgym[i];
      i += 1;
      sgym[i] = x - y;
     } else if ( s[0] == '*' ){
      i -= 1;
      x = sgym[i];
      i -= 1;
      y = sgym[i];
      i += 1;
      sgym[i] = x * y; 
    } else {
      x = atoi(s);
      sgym[i] = x;
      i++;
    }
  }
  printf("%d\n",sgym[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   while( scanf("%s", s) != EOF ){
      |          ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<string.h>
  +++ |+#include <stdio.h>
    3 | #define MAX 100
main.c:8:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   while( scanf("%s", s) != EOF ){
      |          ^~~~~
main.c:8:10: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:28: error: 'EOF' undeclared (first use in this function)
    8 |   while( scanf("%s", s) != EOF ){
      |                            ^~~
main.c:8:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:8:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:36:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   36 |   printf("%d\n",sgym[i]);
      |   ^~~~~~
main.c:36:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:36:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:36:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Push(int *,int ,int *);
int Pop(int *,int *);
int main()
{
int S[100];
int i;
int ans,z;
char a[100];
int s1,s2;
int s_top =0;
for(i=0;i<100;i++)
{
z=scanf("%s",a);
if(z==EOF) break;
//if(atoi(a) != 0 ) Push(S,atoi(a), &s_top);
//else
//{
//s2=Pop(S,&s_top);
//s1=Pop(S,&s_top);
if (a== '+' )ans= Pop(S,&s_top)+Pop(S,&s_top);
else if (a== '-' )ans=Pop(S,&s_top) - Pop(S,&s_top);
else if (a== '*' )ans= Pop(S,&s_top)* Pop(S,&s_top);
else if (a== '/' )ans= Pop(S,&s_top) /  Pop(S,&s_top);
else ans=atoi(a)
Push (S,ans,&s_top);
//}
}
 
printf("%d\n",Pop(S,&s_top));
return 0;
}
 
void Push (int *S,int a,int *s_top)
{
s_top++;
S[*s_top] = a;
}
 
int Pop (int *S, int *s_top)
{
s_top--;
return S[*s_top+1];
}

Compiler output:
main.c: In function 'main':
main.c:23:6: warning: comparison between pointer and integer
   23 | if (a== '+' )ans= Pop(S,&s_top)+Pop(S,&s_top);
      |      ^~
main.c:24:11: warning: comparison between pointer and integer
   24 | else if (a== '-' )ans=Pop(S,&s_top) - Pop(S,&s_top);
      |           ^~
main.c:25:11: warning: comparison between pointer and integer
   25 | else if (a== '*' )ans= Pop(S,&s_top)* Pop(S,&s_top);
      |           ^~
main.c:26:11: warning: comparison between pointer and integer
   26 | else if (a== '/' )ans= Pop(S,&s_top) /  Pop(S,&s_top);
      |           ^~
main.c:27:17: error: expected ';' before 'Push'
   27 | else ans=atoi(a)
      |                 ^
      |                 ;
   28 | Push (S,ans,&s_top);
      | ~~~~
Language: C

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

int main(){
  int x;
  char s[100];

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   12 | pop(1);
      | ^~~
      | popen
main.c:17:7: error: expected ';' before '}' token
   17 | pop(3)
      |       ^
      |       ;
   18 |     }
      |     ~
Language: C

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

int main(){
  int x;
  int i;
  int n[100];
  
  int 
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
 i--;
    } else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
      i--;

    } else if ( s[0] == '*' ){
x[i-2] = x[i-1]*x[i-2];
      i--;

    } else {
      x = atoi(s);
      i++;
    }
  }
printf("%d\n",x[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:3: error: two or more data types in declaration specifiers
   11 |   char s[100];
      |   ^~~~
main.c:15:2: error: subscripted value is neither array nor pointer nor vector
   15 | x[i-2] = x[i-1]+x[i-2];
      |  ^
main.c:15:11: error: subscripted value is neither array nor pointer nor vector
   15 | x[i-2] = x[i-1]+x[i-2];
      |           ^
main.c:15:18: error: subscripted value is neither array nor pointer nor vector
   15 | x[i-2] = x[i-1]+x[i-2];
      |                  ^
main.c:18:2: error: subscripted value is neither array nor pointer nor vector
   18 | x[i-2] = x[i-2]-x[i-1];
      |  ^
main.c:18:11: error: subscripted value is neither array nor pointer nor vector
   18 | x[i-2] = x[i-2]-x[i-1];
      |           ^
main.c:18:18: error: subscripted value is neither array nor pointer nor vector
   18 | x[i-2] = x[i-2]-x[i-1];
      |                  ^
main.c:22:2: error: subscripted value is neither array nor pointer nor vector
   22 | x[i-2] = x[i-1]*x[i-2];
      |  ^
main.c:22:11: error: subscripted value is neither array nor pointer nor vector
   22 | x[i-2] = x[i-1]*x[i-2];
      |           ^
main.c:22:18: error: subscripted value is neither array nor pointer nor vector
   22 | x[i-2] = x[i-1]*x[i-2];
      |                  ^
main.c:26:16: error: passing argument 1 of 'atoi' from incompatible pointer type [-Wincompatible-pointer-types]
   26 |       x = atoi(s);
      |                ^
      |                |
      |                int *
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'int *'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
main.c:30:16: error: subscripted value is neither array nor pointer nor vector
   30 | printf("%d\n",x[i]);
      |                ^
Language: C

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

int main(){
  int x;
  int i;
  int n[100]; 
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
 i--;
    } else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
      i--;

    } else if ( s[0] == '*' ){
x[i-2] = x[i-1]*x[i-2];
      i--;

    } else {
      x = atoi(s);
      i++;
    }
  }
printf("%d\n",x[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |  ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |           ^
main.c:13:18: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |                  ^
main.c:16:2: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |  ^
main.c:16:11: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |           ^
main.c:16:18: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |                  ^
main.c:20:2: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |  ^
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |           ^
main.c:20:18: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |                  ^
main.c:28:16: error: subscripted value is neither array nor pointer nor vector
   28 | printf("%d\n",x[i]);
      |                ^
Language: C

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

int main(){
  int x;
  int i=0;
  int n[100]; 
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
 i--;
    } else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
      i--;

    } else if ( s[0] == '*' ){
x[i-2] = x[i-1]*x[i-2];
      i--;

    } else {
      x = atoi(s);
      i++;
    }
  }
printf("%d\n",x[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |  ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |           ^
main.c:13:18: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |                  ^
main.c:16:2: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |  ^
main.c:16:11: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |           ^
main.c:16:18: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |                  ^
main.c:20:2: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |  ^
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |           ^
main.c:20:18: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |                  ^
main.c:28:16: error: subscripted value is neither array nor pointer nor vector
   28 | printf("%d\n",x[i]);
      |                ^
Language: C

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

main(){
  int x;
  int i=0;
  int n[100]; 
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
 i--;
    } else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
      i--;

    } else if ( s[0] == '*' ){
x[i-2] = x[i-1]*x[i-2];
      i--;

    } else {
      x = atoi(s);
      i++;
    }
  }
printf("%d\n",x[i-2]);
  }

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |  ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |           ^
main.c:13:18: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |                  ^
main.c:16:2: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |  ^
main.c:16:11: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |           ^
main.c:16:18: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |                  ^
main.c:20:2: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |  ^
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |           ^
main.c:20:18: error: subscripted value is neither array nor pointer nor vector
   20 | x[i-2] = x[i-1]*x[i-2];
      |                  ^
main.c:28:16: error: subscripted value is neither array nor pointer nor vector
   28 | printf("%d\n",x[i-2]);
      |                ^
Language: C

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

int main(){
  int x;
  int i;
  int n[100]; 
  char s[100];

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

Compiler output:
main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |  ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |           ^
main.c:13:18: error: subscripted value is neither array nor pointer nor vector
   13 | x[i-2] = x[i-1]+x[i-2];
      |                  ^
main.c:16:2: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |  ^
main.c:16:11: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |           ^
main.c:16:18: error: subscripted value is neither array nor pointer nor vector
   16 | x[i-2] = x[i-2]-x[i-1];
      |                  ^
main.c:19:2: error: subscripted value is neither array nor pointer nor vector
   19 | x[i-2] = x[i-1]*x[i-2];
      |  ^
main.c:19:11: error: subscripted value is neither array nor pointer nor vector
   19 | x[i-2] = x[i-1]*x[i-2];
      |           ^
main.c:19:18: error: subscripted value is neither array nor pointer nor vector
   19 | x[i-2] = x[i-1]*x[i-2];
      |                  ^
main.c:26:16: error: subscripted value is neither array nor pointer nor vector
   26 | printf("%d\n",x[i-1]);
      |                ^
Language: C

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


 main(){
  int x;
  int i;
  int n[100]; 
  char s[100];

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

Compiler output:
main.c:6:2: error: return type defaults to 'int' [-Wimplicit-int]
    6 |  main(){
      |  ^~~~
main.c: In function 'main':
main.c:23:9: error: assignment to expression with array type
   23 |       n = atoi(s);
      |         ^
Language: C

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


 int main(){
  int x;
  int i;
  int n[100]; 
  char s[100];

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

Compiler output:
main.c: In function 'main':
main.c:23:9: error: assignment to expression with array type
   23 |       n = atoi(s);
      |         ^
Language: C

int StackEmpty(int *);
void Push(int *,int);

int top=0;

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

  while( scanf("%s",s1) != EOF ){
    if ( s1[0] == '+' ){
      a = Pop(s2);
      b = Pop(s2);
      Push(s2,a+b);

    } 
    else if ( s1[0] == '-' ){
      a=Pop(s2);
      b=Pop(s2);
      Push(s2,b-a);
    } 
    else if ( s1[0] == '*' ){
      a=Pop(s2);
      b=Pop(s2);
      Push(s2,a*b);
    } 
    else {
      x = atoi(s1);
      Push(s2,x);

    }
  }
  printf("%d\n",s2[top-1]);

  return 0;
}

int Pop(int s[]){
  if(StackEmpty(s) == 1){
    printf("underflow\n");
  }
  else{top--;
	 return s[top];
  }
}

int StackEmpty(int s[]){
  if(top == 0) return 1;
  else return 0;
}


void Push(int s[],int x){

  
  s[top] = x;
  ++top;
}

Compiler output:
main.c: In function 'main':
main.c:10:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |   while( scanf("%s",s1) != EOF ){
      |          ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int StackEmpty(int *);
main.c:10:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |   while( scanf("%s",s1) != EOF ){
      |          ^~~~~
main.c:10:10: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:28: error: 'EOF' undeclared (first use in this function)
   10 |   while( scanf("%s",s1) != EOF ){
      |                            ^~~
main.c:10:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:10:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:11: error: implicit declaration of function 'Pop' [-Wimplicit-function-declaration]
   12 |       a = Pop(s2);
      |           ^~~
main.c:28:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   28 |       x = atoi(s1);
      |           ^~~~
main.c:33:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   33 |   printf("%d\n",s2[top-1]);
      |   ^~~~~~
main.c:33:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:33:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:33:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'Pop':
main.c:40:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   40 |     printf("underflow\n");
      |     ^~~~~~
main.c:40:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<stdlib.h>

int S[100];
int top = 0;

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

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

int main()
{
	char s[6];
	char ch;

	int i = 0;
	while (ch = getchar())
	{
		if (ch != '\n')
		{
			if (ch != ' ')
			{
				s[i] = ch;
				++i;
			}
			else
			{
				s[i] = '\0';
				if (s[0] == '+')
					push(pop() + pop());
				else if (s[0] == '-')
					push(-(pop() - pop()));
				else if (s[0] == '*')
					push(pop() * pop());
				else
					push(atoi(s));
				i = 0;
			}
		}
		else
		{
			s[i] = '\0';
			if (s[0] == '+')
				push(pop() + pop());
			else if (s[0] == '-')
				push(-(pop() - pop()));
			else if (s[0] == '*')
				push(pop() * pop());
			i = 0;
			break;
		}
	}

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

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'getchar' was not declared in this scope
   24 |         while (ch = getchar())
      |                     ^~~~~~~
a.cc:2:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<stdlib.h>
  +++ |+#include <cstdio>
    2 | 
a.cc:61:9: error: 'printf' was not declared in this scope
   61 |         printf("%d\n", pop());
      |         ^~~~~~
a.cc:61:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include‘’stdio.h"
#include<iostream>
using namespace std;

int top = 0;
int A[200] = { 0 };

void push(int n)
{
	++top;
	A[top] = n;
	return;
}

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

int main()
{
	char str[6] = { '\0' };

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

	cout << A[top] << endl;

	return 0;
}


Compiler output:
a.cc:1:2: error: extended character ‘ is not valid in an identifier
    1 | #include‘’stdio.h"
      |  ^
a.cc:1:2: error: extended character ’ is not valid in an identifier
a.cc:1:2: error: invalid preprocessing directive #include\U00002018\U00002019stdio
    1 | #include‘’stdio.h"
      |  ^~~~~~~~~~~~~~
a.cc:1:18: warning: missing terminating " character
    1 | #include‘’stdio.h"
      |                  ^
Language: C++

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

int main(){

    stack<int> s;
    char str[200];
    while(cin.getline(str,200)){
        for(int i=0;i<strlen(str);i++){
            if(isdigit(str[i]))
                s.push(str[i]-'0');
            else if(str[i] != ' '){
                int a=s.top();s.pop();
                int b=s.top();s.pop();
                char c = str[i];
                switch(c){
                    case '+':
                        s.push(b+a);
                        break;
                    case '-':
                        s.push(b-a);
                        break;
                    case '*':
                        s.push(b*a);
                        break;
                }
            }
        }
        cout<<s.top()<<endl;
        s.pop();
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
   11 |         for(int i=0;i<strlen(str);i++){
      |                       ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<stack>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
osikomi(int s[]){
	for(int i = 0;i<200;i++){
		s[i] = s[i+1];
	}
}
int main(){
    int l, i=0;
    int s[200] = {};
    string x;

    while(cin>>x){
    	if(x == "+"){
    		s[0] +=  s[1];
    	//	osikomi(s);
    	}
    	else if(x == "/"){
    		s[0] /=  s[1];
    	//	osikomi(s);
    	}
    	else if(x == "-"){
    		s[0] -=  s[1];
    		//osikomi(s);

    	}
    	else if(x == "*"){
    		s[0] *=  s[1];
    		//osikomi(s);
    	}
    	else{
    		s[i] = stoi(x);
    	}
    	i++;
    	//cout<<s[0]<<endl;
    }cout<<s[0]<<endl;
}


Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'osikomi' with no type [-fpermissive]
    3 | osikomi(int s[]){
      | ^~~~~~~
a.cc: In function 'int osikomi(int*)':
a.cc:7:1: warning: no return statement in function returning non-void [-Wreturn-type]
    7 | }
      | ^
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) { //Ctr + D
    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 pop()':
a.cc:12:8: error: expected ';' before 'return'
   12 |   top--
      |        ^
      |        ;
   13 |   return S[top+1];
      |   ~~~~~~
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include <cstdio>
#include <stack>

int main(){
    std::stack<int> st;
    char s[10];
    int op1,op2;

    while(scanf("%s",s)!=EOF){
        switch(s[0]){
        case '+':
            op2 = st.top();
            st.pop();
            op1 = st.top();
            st.pop();
            st.push(op1+op2);
            break;
        case '-':
            op2 = st.top();
            st.pop();
            op1 = st.top();
            st.pop();
            st.push(op1-op2);
            break;
        case '*':
            op2 = st.top();
            st.pop();
            op1 = st.top();
            st.pop();
            st.push(op1*op2);
            break;
        default:
            st.push(atoi(s));
            break;
        }
    }

    printf("%d\n",st.top());

    return 0;
}



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

#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "Yes" : "No";
}

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

int main(){
    stack<int>a;
    string s;
    while(cin >> s){
        //if(cin.eof()) break;
        
        if(s >= "0" and s<="9"){
            int x = stoi(s)
            a.push(x);
        }else{
            int numA = a.top(); a.pop();
            int numB = a.top(); a.pop();
            
            a.push(calc(numB,numA,s));
        }
        
        if(getchar()=='\n') break;
        
    }
    
    cout << a.top() << endl;
    
}




Compiler output:
a.cc: In function 'int main()':
a.cc:44:13: error: expected ',' or ';' before 'a'
   44 |             a.push(x);
      |             ^
Language: C++

#include <string>
#include <stack>
#include <stdlib.h>
using namespace std;
int a, b,c;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'cin' was not declared in this scope
   11 |         while (cin >> word)
      |                ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <stdlib.h>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout << S.top() << endl;
      |         ^~~~
a.cc:37:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:28: error: 'endl' was not declared in this scope
   37 |         cout << S.top() << endl;
      |                            ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <stdlib.h>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int top,S[1000];
int main(){
    int a,b;(
    top=0;
    char s[100];   
    while(cin>>s){
        if(s[0]=='+'){
            a=pop();
            b=pop();
            push(a+b)
        }
        else if(s[0]=='-'){
            b=pop();
            a=pop();
            push(a-b)
        }
        else if(s[0]=='*'){
            a=pop();
            b=pop();
            push(a*b)
        }
        else{
            push(atoi(s));
        }
    }
    cout<<pop()<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected ')' before ';' token
    6 |     top=0;
      |          ^
      |          )
a.cc:5:13: note: to match this '('
    5 |     int a,b;(
      |             ^
a.cc:10:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   10 |             a=pop();
      |               ^~~
      |               top
a.cc:12:13: error: 'push' was not declared in this scope
   12 |             push(a+b)
      |             ^~~~
a.cc:15:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   15 |             b=pop();
      |               ^~~
      |               top
a.cc:17:13: error: 'push' was not declared in this scope
   17 |             push(a-b)
      |             ^~~~
a.cc:20:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   20 |             a=pop();
      |               ^~~
      |               top
a.cc:22:13: error: 'push' was not declared in this scope
   22 |             push(a*b)
      |             ^~~~
a.cc:25:13: error: 'push' was not declared in this scope
   25 |             push(atoi(s));
      |             ^~~~
a.cc:28:11: error: 'pop' was not declared in this scope; did you mean 'top'?
   28 |     cout<<pop()<<endl;
      |           ^~~
      |           top
Language: C++

#include<bits/stdc++.h>
using namespace std;
int top,S[1000];
int main(){
    int a,b;(
    top=0;
    char s[100];   
    while(cin>>s){
        if(s[0]=='+'){
            a=pop();
            b=pop();
            push(a+b);
        }
        else if(s[0]=='-'){
            b=pop();
            a=pop();
            push(a-b);
        }
        else if(s[0]=='*'){
            a=pop();
            b=pop();
            push(a*b);
        }
        else{
            push(atoi(s));
        }
    }
    cout<<pop()<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected ')' before ';' token
    6 |     top=0;
      |          ^
      |          )
a.cc:5:13: note: to match this '('
    5 |     int a,b;(
      |             ^
a.cc:10:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   10 |             a=pop();
      |               ^~~
      |               top
a.cc:12:13: error: 'push' was not declared in this scope
   12 |             push(a+b);
      |             ^~~~
a.cc:15:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   15 |             b=pop();
      |               ^~~
      |               top
a.cc:17:13: error: 'push' was not declared in this scope
   17 |             push(a-b);
      |             ^~~~
a.cc:20:15: error: 'pop' was not declared in this scope; did you mean 'top'?
   20 |             a=pop();
      |               ^~~
      |               top
a.cc:22:13: error: 'push' was not declared in this scope
   22 |             push(a*b);
      |             ^~~~
a.cc:25:13: error: 'push' was not declared in this scope
   25 |             push(atoi(s));
      |             ^~~~
a.cc:28:11: error: 'pop' was not declared in this scope; did you mean 'top'?
   28 |     cout<<pop()<<endl;
      |           ^~~
      |           top
Language: C++

#include <iostream>
#include <string>
#include <stack>
using namespace std;
int main()
{
    int temp=0;
    string word;
    stack<int> S;
    while(cin>>word)
    {
        if(word=="+")
            temp=S.top();S.pop();
            S.push(S.top()+temp);S.pop();
    }
    else if(word=="-")
    {
        temp=S.top();S.pop();
        S.push(temp-S.top());S.pop();
    }
    else if(word=="*")
    {
        temp=S.top();S.pop();
        S.push(temp*S.top());S.pop();
    }
    else
    {
        S.push(word);
    }
    cout<<S.top()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'else' without a previous 'if'
   16 |     else if(word=="-")
      |     ^~~~
a.cc:28:15: error: no matching function for call to 'std::stack<int>::push(std::string&)'
   28 |         S.push(word);
      |         ~~~~~~^~~~~~
In file included from /usr/include/c++/14/stack:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_stack.h:258:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  258 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_stack.h:258:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::stack<int>::value_type&' {aka 'const int&'}
  258 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_stack.h:263:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(value_type&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  263 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_stack.h:263:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::stack<int>::value_type&&' {aka 'int&&'}
  263 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

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

void add(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]+=num[*pa];
	num[*pa]=0;
	
}

void minus(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]-=num[*pa];
	num[*pa]=0;
}

void multiply(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]*=num[*pa];
	num[*pa]=0;
}

int main(){
	int i,n,j,k,num[200];
	char a[20],s[1000];
	gets(s);
	char *p=s;
	int cur=0;
	int curnum=0;
	for(i=0;i<strlen(s);i++){
		if(*(p+i)=='+'){
			add(num,&curnum);
		}
		if(*(p+i)=='-'){
			minus(num,&curnum);
		}
		if(*(p+i)=='*'){
			multiply(num,&curnum);
		}
		if(*(p+i)<='9'&&*(p+i)>='0'){
			while(*(p+i)!=' '){
				a[cur]=*(p+i);
				cur++;
				i++;
			}
			a[cur]='\0';
			num[curnum]=atoi(a);
			memset(a,0,sizeof(a));
			curnum++;
			cur=0;
		}
	}
	printf("%d\n",num[0]);
}


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

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

void add(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]+=num[*pa];
	num[*pa]=0;
	
}

void minus(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]-=num[*pa];
	num[*pa]=0;
}

void multiply(int num[],int *pa){
	*pa=(*pa)-1;
	num[(*pa)-1]*=num[*pa];
	num[*pa]=0;
}

int main(){
	int i,n,j,k,num[200];
	char s[1000];
	gets(s);
	char *p=s;
	int curnum=0;
	for(i=0;i<strlen(s);i++){
		if(*(p+i)=='+'){
			add(num,&curnum);
		}
		if(*(p+i)=='-'){
			minus(num,&curnum);
		}
		if(*(p+i)=='*'){
			multiply(num,&curnum);
		}
		int ans = 0;
		if(*(p+i)<='9' && *(p+i)>='0'){
			while(*(p+i)!=' '){
				ans = ans*10 + *(p+i) - '0';
				i++;
			}
			num[curnum] = ans;
			curnum++;
		}
	}
	printf("%d\n",num[0]);
}


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


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

int main(){
    stack<int> s;
    int a, b;
    string str;
    
    while(cin>>str){
        if(str=="+"){
            a=s.top(); s.pop();
            b=s.top(); s.pop();
            s.push(a+b);
        }else if(str=="-"){
            a=s.top(); s.pop();
            b=s.top(); s.pop();
            s.push(a-b);
        }else if(str=="*"){
            a=s.top(); s.pop();
            b=s.top(); s.pop();
            s.push(a*b);
        }else s.push(atoi(str));
     }
    cout<<s.top()<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   29 |         }else s.push(atoi(str));
      |                           ^~~
      |                           |
      |                           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:2:
/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>
using namespace std;

class Stack {
public:
    void initialize();
    bool isEmpty();
    bool isFull();
    void push(const int);
    int pop();
    Stack(const int);
    ~Stack();
    
private:
    int top, STACKSIZE;
    vector<int> S;
};

void addition(Stack &s) {
    int a = s.pop(), b = s.pop();
    s.push(a+b);
}

void subtraction(Stack &s) {
    int a = s.pop(), b = s.pop();
    s.push(b - a);
}

void multiplication(Stack &s) {
    int a = s.pop(), b = s.pop();
    s.push(b * a);
}

int main() {
    Stack _s(N);
    char s[100];

    while(scanf("%s", s) != EOF) {
        if(s[0] == '+') {
            addition(_s);
        }

        else if(s[0] == '-') {
            subtraction(_s);
        }

        else if(s[0] == '*') {
            multiplication(_s);
        }

        else {
            _s.push(atoi(s));
        }
    }

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

    return 0;
}

Stack::Stack(const int s) : top(0) {
    STACKSIZE = s;
    vector<int> tmp(STACKSIZE, 0);
    S = tmp;
}

Stack::~Stack() {
    cout << "STACK DELETED" << endl;
}

void Stack::initialize() {
    top = 0;
}

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

bool Stack::isFull() {
    return (top >= STACKSIZE-1);
}

void Stack::push(const int x) {
    if(isFull()) {
        cout << "Overflow!" << endl;
        exit(1);
    }

    top += 1;
    S[top] = x;
}

int Stack::pop() {
    if(isEmpty()) {
        cout << "Underflow" << endl;
        exit(2);
    }

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


Compiler output:
a.cc:16:5: error: 'vector' does not name a type
   16 |     vector<int> S;
      |     ^~~~~~
a.cc: In function 'int main()':
a.cc:35:14: error: 'N' was not declared in this scope
   35 |     Stack _s(N);
      |              ^
a.cc: In constructor 'Stack::Stack(int)':
a.cc:63:5: error: 'vector' was not declared in this scope
   63 |     vector<int> tmp(STACKSIZE, 0);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:63:12: error: expected primary-expression before 'int'
   63 |     vector<int> tmp(STACKSIZE, 0);
      |            ^~~
a.cc:64:5: error: 'S' was not declared in this scope
   64 |     S = tmp;
      |     ^
a.cc:64:9: error: 'tmp' was not declared in this scope; did you mean 'top'?
   64 |     S = tmp;
      |         ^~~
      |         top
a.cc: In member function 'void Stack::push(int)':
a.cc:90:5: error: 'S' was not declared in this scope
   90 |     S[top] = x;
      |     ^
a.cc: In member function 'int Stack::pop()':
a.cc:100:13: error: 'S' was not declared in this scope
  100 |     return (S[top+1]);
      |             ^
Language: C++

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

int main(){

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

    return 0;
}



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

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

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

vector<int> S(1000);
int Top = 0;

int main(void) {

	string str = "0";
	int a, b;
	Top = 0;
	while (str.c_str != "\n") {
		cin >> str;

		if (str == "+") {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (str == "-") {
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (str == "*") {
			a = pop();
			b = pop();
			push(a * b);
		}
		else {
			push(atoi(str.c_str()));
		}
	}
	int x = pop();
	cout << x << endl;

}

void push(int A) {
	Top++;
	S.at(Top) = A;
}

int pop(void) {
	Top--;
	return S.at(Top+1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: invalid use of member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' (did you forget the '()' ?)
   15 |         while (str.c_str != "\n") {
      |                ~~~~^~~~~
      |                         ()
Language: C++

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

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

int S[1000];
int Top = 0;

int main(void) {

	char str[100];
	int a, b;
	Top = 0;
	while (scanf("%s", str) != EOF) {
		cin >> str;

		if (str[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (str[0] == '-') {
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (str[0] == '*') {
			a = pop();
			b = pop();
			push(a * b);
		}
		else {
			push(atoi(str));
		}
	}
	printf("%d\n", pop());

	return 0;
}

void push(int A) {
	Top++;
	S.at(Top) = A;
}

int pop(void) {
	Top--;
	return S.at(Top+1);
}


Compiler output:
a.cc: In function 'void push(int)':
a.cc:44:11: error: request for member 'at' in 'S', which is of non-class type 'int [1000]'
   44 |         S.at(Top) = A;
      |           ^~
a.cc: In function 'int pop()':
a.cc:49:18: error: request for member 'at' in 'S', which is of non-class type 'int [1000]'
   49 |         return S.at(Top+1);
      |                  ^~
Language: C++

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

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

int S[1000];
int Top = 0;

int main(void) {

	string str;
	int a, b;
	Top = 0;
	while (str != "-1") {

		if (str[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (str[0] == '-') {
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (str[0] == '*') {
			a = pop();
			b = pop();
			push(a * b);
		}
		else {
			push(atoi(str.c_str));
		}
	}
	printf("%d\n", pop());

	return 0;
}

void push(int A) {
	S[++Top] = A;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:33:39: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   33 |                         push(atoi(str.c_str));
      |                                   ~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

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

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

int S[1000];
int Top = 0;

int main(void) {

	string str;
	int a, b;
	Top = 0;
	while (str != "-1") {
		cin >> str;

		if (str[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		}
		else if (str[0] == '-') {
			b = pop();
			a = pop();
			push(a - b);
		}
		else if (str[0] == '*') {
			a = pop();
			b = pop();
			push(a * b);
		}
		else {
			push(atoi(str.c_str));
		}
	}
	printf("%d\n", pop());

	return 0;
}

void push(int A) {
	S[++Top] = A;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:34:39: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   34 |                         push(atoi(str.c_str));
      |                                   ~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~