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

#include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>

int stack[100];
int top = 0;

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

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

int getInt(char *s){
    int i
    int ret=0;
    int size = strlen(s);
    
    for(i=0;i<size;i++){
        ret += (s[i]-'0')*pow(10,size-i-1);
    }
    return ret;
}

int main(){
    
    char s[1000];
    while(scanf("%s",s)!=EOF){
        if('0' <= s[0] && s[0] <= '9'){
          int v = getInt(s);
          push(v);
          continue;
            
        }
        
        int a,b;
        b = pop();
        a = pop();
        
        if(s[0] == '+'){
            push(a+b);
        }
        else if(s[0] == '-'){
            push(a-b);
        }
        else if(s[0] == '*'){
            push(a*b);
        }
        else{
            assert(0);
        }
    }
        
        printf("%d\n",pop());
        return 0;
        
}



Compiler output:
main.c: In function 'getInt':
main.c:18:10: error: expected ';' before 'int'
   18 |     int i
      |          ^
      |          ;
   19 |     int ret=0;
      |     ~~~   
main.c:22:9: error: 'i' undeclared (first use in this function)
   22 |     for(i=0;i<size;i++){
      |         ^
main.c:22:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>
int stack[110];
int top = 0;

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

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

int getInt(char *s){
	int i, ret = 0;
	int size = strlen(s);

	for (i = 0; i<size; i++){
		ret += (s[i] - '0')*pow(10, size - i - 1);
	}
	return ret;
}

int main(){
	char s[1000];
	int a, b;

	while (scanf_s("%s", s, 100) != EOF){
		if ('0' <= s[0] && s[0] <= '9'){
			int v = getInt(s);
			push(v);
			continue;
		}
		
		b = pop();
		a = pop();
		if (s[0] == '+'){
			push(a + b);
		}
		else if (s[0] == '-'){
			push(a - b);
		}
		else if (s[0] == '*'){
			push(a*b);
		}
		else{
			assert(0);
		}
	}
	printf("%d\n", pop());
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   30 |         while (scanf_s("%s", s, 100) != EOF){
      |                ^~~~~~~
      |                scanf
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:15:7: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   15 |       push (atoi(s));
      |       ^~~~
main.c:17:22: error: 'p' undeclared (first use in this function)
   17 |   printf("%d\n", S[--p]);
      |                      ^
main.c:17:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

//using namespace std;



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

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



int main(){
	int top, S[1000];
	char s[100];
	top = 0;
	//initialize;
	int a,b;
	while(scanf("%s",s) != EOF){

		//cout << "hoge" << endl;
		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 << "hahah" << endl;

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

	return 0;


}

Compiler output:
main.c: In function 'push':
main.c:11:9: error: 'S' undeclared (first use in this function)
   11 |         S[++top] = x;
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:13: error: 'top' undeclared (first use in this function)
   11 |         S[++top] = x;
      |             ^~~
main.c: In function 'pop':
main.c:15:9: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   15 |         top--;
      |         ^~~
      |         pop
main.c:16:16: error: 'S' undeclared (first use in this function)
   16 |         return S[top + 1];
      |                ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
??
#define MAX 200
??
int sp = MAX;
int stack[MAX];
??
static void push(int a) {
????????if (sp > 0) {
????????????????stack[--sp] = a;
????????} else {
????????????????fprintf(stderr, "push error\n");
????????}
}
??
static int pop() {
????????if (sp < MAX) {
????????????????return stack[sp++];
????????} else {
????????????????return 0;
????????}
}
??
??
int main() {
????????char s[MAX];
????????int x = 0, y = 0;
??
????????while (scanf("%s", s) != EOF) {
????????????????if (s[0] == '+') {
????????????????????????push(pop() + pop());
????????????????} else if (s[0] == '-') {
????????????????????????y = pop();
????????????????????????x = pop();
????????????????????????push(x - y);
????????????????} else if (s[0] == '*') {
????????????????????????push(pop() * pop());
????????????????} else {
????????????????????????push(atoi(s));
????????????????}
????????}
??
????????printf("%d\n", pop());
??
????????return 0;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:17:1: error: expected identifier or '(' before '?' token
   17 | ??
      | ^
main.c:25:1: error: expected identifier or '(' before '?' token
   25 | ??
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
int main(){
  int x,a[101],count=1;
  char str[100];
 
  while(scanf("%s",str) != EOF){
    if(s[0]=='+'){
      a[count-2] += a[count-1];  
      count--;
    }

    else if(s[0]=='-'){
      a[count-2]-=a[count-1];
      count--;
    }

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

    else{
      x=atoi(s);
      a[count]=x;
      count++;
    }
  }
  printf("%d\n",a[b-1]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:8: error: 's' undeclared (first use in this function)
   10 |     if(s[0]=='+'){
      |        ^
main.c:10:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:19: error: 'b' undeclared (first use in this function)
   31 |   printf("%d\n",a[b-1]);
      |                   ^
Language: C

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

void push(int);
int pop(void);
int st[100];
int sp = 0;


int main(){
  int x,j=0;
  char s[100];

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

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

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

    } else {
      if(s[j++] == '+' || s[j++] == '-' || s[j++] = '*'){
	pop()

      else{x = atoi(s);
      push(x);
      }
      
    }
  }

  return 0;
  }

void push(int w) {

      st[sp++]=w;

  }

  int pop() {

      return st[--sp];

  }

Compiler output:
main.c: In function 'main':
main.c:23:51: error: lvalue required as left operand of assignment
   23 |       if(s[j++] == '+' || s[j++] == '-' || s[j++] = '*'){
      |                                                   ^
main.c:24:14: error: expected ';' before 'else'
   24 |         pop()
      |              ^
      |              ;
   25 | 
   26 |       else{x = atoi(s);
      |       ~~~~    
main.c:46:3: error: expected declaration or statement at end of input
   46 |   }
      |   ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:18:29: error: expected ';' before '}' token
   18 |       x[top]=x[top]*x[top+1]
      |                             ^
      |                             ;
   19 |     }
      |     ~                        
main.c:22:16: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   22 |       x[top] = atoi(s);
      |                ^~~~
Language: C

#include<stdio.h>
#define N 100

int main(int argc, char *argv[]){
  int i,j,a[N],b,c,d;

  for(i=0;i<d-1;i++){
    for(j=0;j<2;j++){
      scanf("%d%d",a[j]a[j+1]);
    }
  if(scanf("%d",c)== +){
    d = a[0] + a[1];
  }
  if(scanf("%d",c)== -){
    d = a[0] - a[1];
  }

Compiler output:
main.c: In function 'main':
main.c:9:24: error: expected ')' before 'a'
    9 |       scanf("%d%d",a[j]a[j+1]);
      |            ~           ^
      |                        )
main.c:11:23: error: expected expression before ')' token
   11 |   if(scanf("%d",c)== +){
      |                       ^
main.c:14:23: error: expected expression before ')' token
   14 |   if(scanf("%d",c)== -){
      |                       ^
main.c:16:3: error: expected declaration or statement at end of input
   16 |   }
      |   ^
main.c:16:3: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
#define N 100
#define M 99


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

  int i,j,sum=0,k=0;
  int S[N];
  char t[M];
  for(i=0;i<argc;i++){
    scanf("%d",&S[i]);
    push(S[i]);
    if(S[i]== + || S[i]== - || S[i] == *){
      sum = S[i-1]+S[i-2];
      pop();
      pop();
      push(sum);
      }
    sum=0;
  }

  printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   13 |     push(S[i]);
      |     ^~~~
main.c:14:17: error: expected expression before '||' token
   14 |     if(S[i]== + || S[i]== - || S[i] == *){
      |                 ^~
main.c:16:7: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   16 |       pop();
      |       ^~~
      |       popen
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<stdring .h>
#define N 100

int

main(){
  
  int x[],i=0;
  char s[N];

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

Compiler output:
main.c:3:9: fatal error: stdring .h: No such file or directory
    3 | #include<stdring .h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 100

int

main(){
  
  int x[],i=0;
  char s[N];

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

Compiler output:
main.c: In function 'main':
main.c:9:7: error: array size missing in 'x'
    9 |   int x[],i=0;
      |       ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100;


int main(){
  int y[N],i,x;
  char s[N];
 
  while( scanf("%s", s) != EOF ){
   
    if ( s[0] == '+' ){
      y[i-2] = y[i-2] + y[i-1];
      i--;
    }
    
    else if ( s[0] == '-' ){
      y[i-2] = y[i-2] - y[i-1];
      i--;
    }
    
    else if ( s[0] == '*' ){
      y[i-2] = y[i-2] * y[i-1];
      i--;
    }
    
    else {
      x = atoi(s);
      y[i] = x;
      i++;
    } 
    
  }

  printf("%d\n",y[i-1]);
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:4:14: error: expected ']' before ';' token
    4 | #define N 100;
      |              ^
main.c:8:9: note: in expansion of macro 'N'
    8 |   int y[N],i,x;
      |         ^
main.c:4:14: error: expected ']' before ';' token
    4 | #define N 100;
      |              ^
main.c:9:10: note: in expansion of macro 'N'
    9 |   char s[N];
      |          ^
main.c:11:22: error: 's' undeclared (first use in this function)
   11 |   while( scanf("%s", s) != EOF ){
      |                      ^
main.c:11:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:7: error: 'y' undeclared (first use in this function)
   14 |       y[i-2] = y[i-2] + y[i-1];
      |       ^
main.c:14:9: error: 'i' undeclared (first use in this function)
   14 |       y[i-2] = y[i-2] + y[i-1];
      |         ^
main.c:29:7: error: 'x' undeclared (first use in this function)
   29 |       x = atoi(s);
      |       ^
Language: C

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

main(){
  int x, a, b;
  char s[1000000];
  while(scanf("%s", s) != EOF){
    switch(s[0]){
    case '+':
      a = pop();
      b = pop();
      top++;
      operands[top] = a + b;
      break;
      
    case '-':
      a = pop();
      b = pop();
      top++;
      operands[top] = b - a;
      break;
      
    case '*':
      a = pop();
      b = pop();
      top++;
      operands[top] = a * b;
      break;
      
    default :
      x = atoi(s);
      push(x);
      break;
    }
  }
  printf("%d\n", operands[1]);
  return 0;
}

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

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

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |   while(scanf("%s", s) != EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void push(int);
main.c:7:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |   while(scanf("%s", s) != EOF){
      |         ^~~~~
main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:27: error: 'EOF' undeclared (first use in this function)
    7 |   while(scanf("%s", s) != EOF){
      |                           ^~~
main.c:7:27: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:7:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:7: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   12 |       top++;
      |       ^~~
      |       pop
main.c:13:7: error: 'operands' undeclared (first use in this function)
   13 |       operands[top] = a + b;
      |       ^~~~~~~~
main.c:31:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   31 |       x = atoi(s);
      |           ^~~~
main.c:36:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   36 |   printf("%d\n", operands[1]);
      |   ^~~~~~
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'
main.c: In function 'push':
main.c:41:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   41 |   top++;
      |   ^~~
      |   pop
main.c:42:3: error: 'operands' undeclared (first use in this function)
   42 |   operands[top] = x;
      |   ^~~~~~~~
main.c: In function 'pop':
main.c:46:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   46 |   top--;
      |   ^~~
      |   pop
main.c:47:10: error: 'operands' undeclared (first use in this function)
   47 |   return operands[top+1];
      |          ^~~~~~~~
Language: C

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

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

Compiler output:
main.c: In function 'main':
main.c:28:3: error: expected declaration or statement at end of input
   28 |   return 0;
      |   ^~~~~~
Language: C

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

int top = 0;
int stack[200];

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

int main() {
  char x;
  int a, b, c;

  while(1){
    if(scanf("%c", &x) == EOF)
      break;

    //push
    else if(x >= 0 && x <= 9){
      push( atoi(&x) );
    }
    //演算子の場合
    else{
      a = pop();
      b = pop();

      //演算子への対応
      if(&x == "+")
	c = a+b;
	push(c);
      else if(&x == "-")
	c = b-a;
	push(c);
      else
	c = a*b;
	push(c);

    }
  }

  printf("%d\n", stack[top]);

  return 0;
}

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

int pop(void){
  int a;
  a = stack[top];
  top--;
  return a;
}

Compiler output:
main.c: In function 'main':
main.c:31:7: error: 'else' without a previous 'if'
   31 |       else if(&x == "-")
      |       ^~~~
main.c:34:7: error: 'else' without a previous 'if'
   34 |       else
      |       ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAX 101
 
void initialize();
int Empty();
int Full();
void push(int);
int pop();
 
int n[MAX],top;
 
int main(){
  char m[MAX];
  int a,b;
 
  initialize();
 
  while(scanf("%s", m) != EOF){
    if(m[0] == '+'){
     b = pop();
     a = pop();
     push(a+b);
   }
   else if(m[0] == '-'){
    b = pop();
    a = pop();
    push(a-b);
  }
  else if(m[0] == '*'){
    b = pop();
    a = pop();
    push(a*b);
  }
  else {
    push(atoi(m));
  }
}
 
printf("%d\n", n[top]);
return 0;
}
 
void initialize(){
  top = 0;
}
 
int Empty(){
  return top == 0;
}
 
int Full(){
  return top >= MAX - 1;
}
 
void push(x){
  if(Full()){
    printf("WTF1\n");
    exit(1);
  }
  top++;
  n[top] = m;
}
 
int pop(){
  if (Empty()){
    printf("WTF2\n");
    exit(2);
  }
  top--;
  return n[top+1];
}

Compiler output:
main.c: In function 'push':
main.c:56:6: error: type of 'x' defaults to 'int' [-Wimplicit-int]
   56 | void push(x){
      |      ^~~~
main.c:62:12: error: 'm' undeclared (first use in this function)
   62 |   n[top] = m;
      |            ^
main.c:62:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define STACK_MAX 100

int push(int);
int pop(void);
int cal(char);

int stack[STACK_MAX];
int top=0;

main(){
  char S[200];
  scanf("%s",S);
  printf("%d",cal(S));

  return 0;
}


int cal(char S[]){
  int i,a,b;
  for(i=0;S[i] !='\0';i++){

    switch(S[i]){
    case '+':
      a = pop();
      b = pop();
      push(a+b);
      break;

    case '-':
      a = pop();
      b = pop();
      push(a-b);
      break;

    case '*':
      a=pop();
      b=pop();
      push(a*b);
      break;
      
    default :
      push(S[i]);
    break;
    }
  }
  return pop();
}

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

int isFull(){
  return top >= MAX -1;
}


int push(x){
  if (isFull()) break; 
  top++;
  S[top] = x;
}


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

Compiler output:
main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
   12 | main(){
      | ^~~~
main.c: In function 'main':
main.c:15:19: error: passing argument 1 of 'cal' makes integer from pointer without a cast [-Wint-conversion]
   15 |   printf("%d",cal(S));
      |                   ^
      |                   |
      |                   char *
main.c:7:9: note: expected 'char' but argument is of type 'char *'
    7 | int cal(char);
      |         ^~~~
main.c: At top level:
main.c:21:5: error: conflicting types for 'cal'; have 'int(char *)'
   21 | int cal(char S[]){
      |     ^~~
main.c:7:5: note: previous declaration of 'cal' with type 'int(char)'
    7 | int cal(char);
      |     ^~~
main.c: In function 'isFull':
main.c:57:17: error: 'MAX' undeclared (first use in this function)
   57 |   return top >= MAX -1;
      |                 ^~~
main.c:57:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'push':
main.c:61:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
   61 | int push(x){
      |     ^~~~
main.c:62:17: error: break statement not within loop or switch
   62 |   if (isFull()) break;
      |                 ^~~~~
main.c:64:3: error: 'S' undeclared (first use in this function)
   64 |   S[top] = x;
      |   ^
main.c: In function 'pop':
main.c:69:18: error: break statement not within loop or switch
   69 |   if (isEmpty()) break;
      |                  ^~~~~
main.c:71:10: error: 'S' undeclared (first use in this function)
   71 |   return S[top+1];
      |          ^
Language: C

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

int main(){
  int stack[101], s_top = 0, x, i;
  char n;

  while ((scanf("%s" ,&n) != EOF){
    if(n == '+'){
      s_top -= 1;
      x = stack[s_top];
      x += stack[s_top + 1];
    }
    else if(n == '-'){
      s_top -= 1;
      x = stack[s_top];
      x -= stack[s_top + 1];
    }
    else if(n == '*'){
      s_top -= 1;
      x = stack[s_top];
      x *= stack[s_top + 1];
    }
    else{
      x = atoi(&n);
      s_top += 1;
    }
    stack[s_top] = x;


    printf("%d\n" ,stack[s_top]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:34: error: expected ')' before '{' token
    8 |   while ((scanf("%s" ,&n) != EOF){
      |         ~                        ^
      |                                  )
main.c:34:1: error: expected expression before '}' token
   34 | }
      | ^
Language: C

int top = 0;

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


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

  
  

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

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

  return 0;
  
}

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


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

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

Compiler output:
main.c:2:1: error: expected identifier or '(' before '}' token
    2 | }
      | ^
main.c: In function 'pop':
main.c:4:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
    4 |   top--;
      |   ^~~
      |   pop
main.c:4:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:10: error: 's' undeclared (first use in this function)
    5 |   return s[top+1];
      |          ^
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   while(scanf("%s",a)!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:11:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   while(scanf("%s",a)!=EOF){
      |         ^~~~~
main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:24: error: 'EOF' undeclared (first use in this function)
   11 |   while(scanf("%s",a)!=EOF){
      |                        ^~~
main.c:11:24: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:12:18: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   12 |     if(a[0]=='+')push(pop()+pop());
      |                  ^~~~
main.c:18:15: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   18 |     else push(atoi(a));
      |               ^~~~
main.c:20:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |   printf("%d\n",pop());
      |   ^~~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:3: error: expected declaration or statement at end of input
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:33:9: error: subscripted value is neither array nor pointer nor vector
   33 |     if(c[0] == '+'){
      |         ^
main.c:36:14: error: subscripted value is neither array nor pointer nor vector
   36 |     else if(c[0] == '-'){
      |              ^
main.c:40:16: error: subscripted value is neither array nor pointer nor vector
   40 |     } else if(c[0] == '*') {
      |                ^
main.c:43:17: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   43 |       push(atoi(c));
      |                 ^
      |                 |
      |                 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:46:3: error: expected declaration or statement at end of input
   46 |   }
      |   ^
Language: C

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      | ^
Language: C

#include <iostream>
#include <cstdlib>

template <typename T>
class stack{
  T a[101];
  unsigned n;
public:
  stack():a(),n(0){}
  T& top(){return a[n-1];}
  T pop(){return a[--n];}
  void push(T in){a[n++]=in;}
};

int main(){
  std::ios::sync_with_stdio(false);
  stack<int> s;
  char buf[100];

  while(std::cin >> buf){
    int a;
    switch(buf[0]){
      case '+' : a = s.pop(); s.top() += a; break;
      case '-' : a = s.pop(); s.top() -= a; break;
      case '*' : a = s.pop(); s.top() *= a; break;
      default  : s.push(atoi(buf));
    }
  }
  std::cout << s.top() << '\n';
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

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

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
Language: C

#include <stdio.h>

#define Max 1000
int top = 0;

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

int isFull( ) {
	return top >= Max -1;
}

void push(int stack[Max], int value) {
	if (isFull( )) {
		printf("error\n");
		exit(1);
	}
	stack[++top]  = value;
}

int pop(int stack[Max]) {
	if (isEmpty( )) {
		printf("error\n");
		exit(1);
	}
	return stack[top--];
}

int main( ) {
	int N, i;
	char A[Max];
	int buff;
	int stack[Max]; 
	int sp = 0;
	int count = 0;
	int count_num = 0;

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

	if (count == 0 || count <= 1) exit(1);

	printf("%d\n",stack[top]);

	return 0;
}

Compiler output:
main.c: In function 'push':
main.c:17:17: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   17 |                 exit(1);
      |                 ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:17:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   17 |                 exit(1);
      |                 ^~~~
main.c:17:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'pop':
main.c:25:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   25 |                 exit(1);
      |                 ^~~~
main.c:25:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'main':
main.c:43:37: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   43 |                 else    push(stack, atoi(A)) {count_num++; count--;}
      |                                     ^~~~
main.c:43:45: error: expected ';' before '{' token
   43 |                 else    push(stack, atoi(A)) {count_num++; count--;}
      |                                             ^~
      |                                             ;
main.c:47:39: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   47 |         if (count == 0 || count <= 1) exit(1);
      |                                       ^~~~
main.c:47:39: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

#include <stdio.h>

#define Max 1000
int top = 0;

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

int isFull( ) {
	return top >= Max -1;
}

void push(int stack[Max], int value) {
	if (isFull( )) {
		printf("error\n");
		exit(1);
	}
	stack[++top]  = value;
}

int pop(int stack[Max]) {
	if (isEmpty( )) {
		printf("error\n");
		exit(1);
	}
	return stack[top--];
}

int main( ) {
	int N, i;
	char A[Max];
	int buff;
	int stack[Max]; 
	int sp = 0;

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

	printf("%d\n",stack[top]);

	return 0;
}

Compiler output:
main.c: In function 'push':
main.c:17:17: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   17 |                 exit(1);
      |                 ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:17:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   17 |                 exit(1);
      |                 ^~~~
main.c:17:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'pop':
main.c:25:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   25 |                 exit(1);
      |                 ^~~~
main.c:25:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'main':
main.c:41:37: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   41 |                 else    push(stack, atoi(A);
      |                                     ^~~~
main.c:41:44: error: expected ')' before ';' token
   41 |                 else    push(stack, atoi(A);
      |                             ~              ^
      |                                            )
main.c:41:45: error: expected ';' before '}' token
   41 |                 else    push(stack, atoi(A);
      |                                             ^
      |                                             ;
   42 |         }
      |         ~
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(int x)
{
	top--;
	//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 if(s[0] == '/'){
			a = pop();
			b = pop();
		    push(a/b);
		} else{
			push(atoi(s));
		}
	}
	printf("%d\n", pop());
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:29: error: too few arguments to function 'pop'
   27 |                         a = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:28:29: error: too few arguments to function 'pop'
   28 |                         b = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:31:29: error: too few arguments to function 'pop'
   31 |                         a = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:32:29: error: too few arguments to function 'pop'
   32 |                         b = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:35:29: error: too few arguments to function 'pop'
   35 |                         a = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:36:29: error: too few arguments to function 'pop'
   36 |                         b = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:39:29: error: too few arguments to function 'pop'
   39 |                         a = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:40:29: error: too few arguments to function 'pop'
   40 |                         b = pop();
      |                             ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
main.c:46:24: error: too few arguments to function 'pop'
   46 |         printf("%d\n", pop());
      |                        ^~~
main.c:13:5: note: declared here
   13 | int pop(int x)
      |     ^~~
Language: C

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

int value[100];
int sp = 0;

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

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

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

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

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

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

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

    return 0;

Compiler output:
main.c: In function 'main':
main.c:53:5: error: expected declaration or statement at end of input
   53 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,S[1000];

void push(int);
int main(){
  int x,a,b;
  char s[100];

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

    } else if ( s[0] == '-' ){
      a=pop();
      b=pop();
      push(a-b);

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

Compiler output:
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   13 |       a=pop();
      |         ^~~
      |         popen
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] == '-'){
      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:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'push':
main.c:8:3: error: 'S' undeclared (first use in this function)
    8 |   S[++top] = x;
      |   ^
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:7: error: 'top' undeclared (first use in this function)
    8 |   S[++top] = x;
      |       ^~~
main.c: In function 'pop':
main.c:12:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   12 |   top--;
      |   ^~~
      |   pop
main.c:13:10: error: 'S' undeclared (first use in this function)
   13 |   return S[top+1];
      |          ^
main.c: In function 'main':
main.c:18:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   18 |   top = 0;
      |   ^~~
      |   pop
main.c:21:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   21 |   while(scanf("%s",s) != EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:21:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   21 |   while(scanf("%s",s) != EOF){
      |         ^~~~~
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:21:26: error: 'EOF' undeclared (first use in this function)
   21 |   while(scanf("%s",s) != EOF){
      |                          ^~~
main.c:21:26: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:38:12: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   38 |       push(atoi(s));
      |            ^~~~
main.c:42:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   42 |   printf("%d\n",pop());
      |   ^~~~~~
main.c:42:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:42:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:42:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];

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


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

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

    } else if ( s[0] == '-' ){
      a=pop();
      b=pop();
      push(b-a);

    } else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(a*b);
    } else {
      x = atoi(s);
      push(x);
    }
  }
  printf("%d\n",pop());
  return 0;
}
  if(top>=100-1)return 0;
  return 1;
}





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

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


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

int isFULL()
{

Compiler output:
main.c:39:3: error: expected identifier or '(' before 'if'
   39 |   if(top>=100-1)return 0;
      |   ^~
main.c:40:3: error: expected identifier or '(' before 'return'
   40 |   return 1;
      |   ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
main.c: In function 'isFULL':
main.c:68:1: error: expected declaration or statement at end of input
   68 | {
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];

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


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

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

    } else if ( s[0] == '-' ){
      a=pop();
      b=pop();
      push(b-a);

    } else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(a*b);
    } else {
      x = atoi(s);
      push(x);
    }
  }
  printf("%d\n",pop());
  return 0;
}
  if(top>=100-1)return 0;
  return 1;
}





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

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


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

int isFULL()
{
  if(top>=100-1)return 0;
  return 1;
}

Compiler output:
main.c:39:3: error: expected identifier or '(' before 'if'
   39 |   if(top>=100-1)return 0;
      |   ^~
main.c:40:3: error: expected identifier or '(' before 'return'
   40 |   return 1;
      |   ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C

#include<stdio.h>

#define STACK_SIZE 100
#define MAX_LEN 100

int pop();
int push(int);
int is_digit(char *);
int get_number(char *);
int calc_rpn(char *);
 
int stack[STACK_SIZE];
int stack_size = 0;

int main(){
  
  char s[MAX_LEN];
  
  scanf("%[^\n]*s",s);
  printf("%d\n",calc_rpn(s));

 
 return 0;
}

int pop()
{
  if(stack_size <= 0)return 0;
  return stack[--stack_size];
  
}


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


int is_digit(char *s)
{


  if(*s == '+'|| *s == '-'){
    s++;
    if(*s>='0'&&*s<='9')return 1;
    return 0;
  }
  if(*s>='0'&&*s<='9')return 1;
  return 0;
}


int get_number(char *s)
{

  int sign = 0,n = 0;

  if(*s == '+'){
    s++;
  }
  else if(*s == '-'){
    sign = 1;
    s++;
  }
  while(*s >= '0'&& *s <='9'){
    n = n * 10 + (*s - '0');
    s++;
  }
  
  if(sign)return -n;
  return n;
}

int calc_rpn(char *s)
{

  int a,b,n;
  
  while(*s){
    if(is_digit(s)){
      n=get_number(s);
      push(n);
      while(*s=='-'||*s=='+'){
	s++;
      }
      while(n){
	n/=10;
	s++;
      }
    }
    else{
      switch(*s){
      case '+':
      a = pop();
      b = pop();
      push(b+a);
      break;
      
      case '-':
      a = pop();
      b = pop();
      push(b-a);
      break;
      
      case '*': 
      a = pop();
      b = pop();
      push(b*a);
      break;

      s++;
    }
  }
  return pop();
}

Compiler output:
main.c: In function 'calc_rpn':
main.c:116:1: error: expected declaration or statement at end of input
  116 | }
      | ^
Language: C

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

#define MAX 100

void initialize(void)
int isempty(void);
int isfull(void);
void push(int);
int pop(void);

int top;
int stack[MAX];

int main()
{
  int a, b;
  char s[MAX];
  initialize();
  while(scanf("%s", s) != EOF) {
    switch(s[0]) {
    case '+':
      a = pop();
      b = pop();
      push(a+b);
      break;
    case '-':
      a = pop();
      b = pop();
      push(b-a);
      break;
    case '*':
      a = pop();
      b = pop();
      push(a*b);
      break;
    default:
      push(atoi(s));
      break;
    }
  }
  printf("%d\n", pop());
  return 0;
}
  
void initialize()
{
  top = 0;
}

int isempty()
{
  if(top == 0)
    return 1;
  else
    return 0;
}
  
int isfull()
{
  if(top >= MAX-1)
    return 1;
  else
    return 0;
}

void push(int x)
{
  if(isfull()) {
    fprintf(stderr, "エラー（オーバーフロー）\n");
    exit(1);
  }
  stack[++top] = x;
}

int pop()
{
  if(isempty()) {
    fprintf(stderr, "エラー（オーバーフロー）\n");
    exit(1);
  }
  top--;
  return stack[top+1];
}

Compiler output:
main.c: In function 'initialize':
main.c:16:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   16 | {
      | ^
main.c:47:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   47 | {
      | ^
main.c:52:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   52 | {
      | ^
main.c:60:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   60 | {
      | ^
main.c:68:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   68 | {
      | ^
main.c:77:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   77 | {
      | ^
main.c:6:6: error: old-style parameter declarations in prototyped function definition
    6 | void initialize(void)
      |      ^~~~~~~~~~
main.c:85: error: expected '{' at end of input