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

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

#define SIZE 201;
nt stack[SIZE];
int s;

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

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

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

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

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

int getnum(char *s){
  int check=0,n=0;

  if(*s == '+'){
    s++;
  }
  else if(*s == '-'){
    check=1;
    s++;
  }

  while(*s >= '0' && *s <= '9'){
    n = n*10+(*s - '0');
    s++;
  }

  if(check == 1) return -n;
  return n;
}

int cal(char *s){
  int a,b,num;

  while(*s!=NULL){
    if(judge(s)==1){
      num = getnum(s);
      push(num);
      while(*s == '+' || *s == '-'){
	s++;
      }
      while(num){
	num=num/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:6:1: error: unknown type name 'nt'; did you mean 'int'?
    6 | nt stack[SIZE];
      | ^~
      | int
main.c:5:17: error: expected ']' before ';' token
    5 | #define SIZE 201;
      |                 ^
main.c:6:10: note: in expansion of macro 'SIZE'
    6 | nt stack[SIZE];
      |          ^~~~
main.c: In function 'main':
main.c:5:17: error: expected ']' before ';' token
    5 | #define SIZE 201;
      |                 ^
main.c:11:10: note: in expansion of macro 'SIZE'
   11 |   char s[SIZE];
      |          ^~~~
main.c:13:17: error: implicit declaration of function 'cal' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",cal(s));
      |                 ^~~
main.c: In function 'pop':
main.c:19:10: error: 'stack' undeclared (first use in this function)
   19 |   return stack[--s];
      |          ^~~~~
main.c:19:10: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'push':
main.c:24:3: error: 'stack' undeclared (first use in this function)
   24 |   stack[s++]=a;
      |   ^~~~~
main.c: In function 'cal':
main.c:65:11: warning: comparison between pointer and integer
   65 |   while(*s!=NULL){
      |           ^~
Language: C

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

#define SIZE 201;
int stack[SIZE];
int s;

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

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

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

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

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

int getnum(char *s){
  int check=0,n=0;

  if(*s == '+'){
    s++;
  }
  else if(*s == '-'){
    check=1;
    s++;
  }

  while(*s >= '0' && *s <= '9'){
    n = n*10+(*s - '0');
    s++;
  }

  if(check == 1) return -n;
  return n;
}

int cal(char *s){
  int a,b,num;

  while(*s!=NULL){
    if(judge(s)==1){
      num = getnum(s);
      push(num);
      while(*s == '+' || *s == '-'){
	s++;
      }
      while(num){
	num=num/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:5:17: error: expected ']' before ';' token
    5 | #define SIZE 201;
      |                 ^
main.c:6:11: note: in expansion of macro 'SIZE'
    6 | int stack[SIZE];
      |           ^~~~
main.c: In function 'main':
main.c:5:17: error: expected ']' before ';' token
    5 | #define SIZE 201;
      |                 ^
main.c:11:10: note: in expansion of macro 'SIZE'
   11 |   char s[SIZE];
      |          ^~~~
main.c:13:17: error: implicit declaration of function 'cal' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",cal(s));
      |                 ^~~
main.c: In function 'pop':
main.c:19:10: error: 'stack' undeclared (first use in this function)
   19 |   return stack[--s];
      |          ^~~~~
main.c:19:10: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'push':
main.c:24:3: error: 'stack' undeclared (first use in this function)
   24 |   stack[s++]=a;
      |   ^~~~~
main.c: In function 'cal':
main.c:65:11: warning: comparison between pointer and integer
   65 |   while(*s!=NULL){
      |           ^~
Language: C

#include<stdio.h>

int main(){
  
  int st[],i;
  char c;
  
  while(scanf("%d",&c)!=EOF){
    
    
    if(c>=48 && c<=57){
      st[i]=(int)c;
	i++;
    }
    else {
      
      if(c=='+'){

	
      }
      

    }
     }
  








  return 0;
}

void push(int st[],int *top,int item){
  int x;

  x=*top;
  st[x]=item;
  *top=x+1;

}

int pop(int st[],int *top){
  int x;
  x=*top-1;
  item=st[x];
  *top=x;
  return item;

}



Compiler output:
main.c: In function 'main':
main.c:5:7: error: array size missing in 'st'
    5 |   int st[],i;
      |       ^~
main.c: In function 'pop':
main.c:49:3: error: 'item' undeclared (first use in this function)
   49 |   item=st[x];
      |   ^~~~
main.c:49:3: 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>

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(b+a);
    }else if(s[0]=='-'){
*      a=pop();
      b=pop();
      push(b-a);
    }else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }else {
      push(atoi(s)); 
    }
  }

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

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:27:1: error: invalid type argument of unary '*' (have 'int')
   27 | *      a=pop();
      | ^~~~~~~~
Language: C

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

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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top, x[1000];
int main()
{
  int a, b;
  char c[100];
  top = 0;

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



Compiler output:
main.c: In function 'main':
main.c:11:21: error: 's' undeclared (first use in this function)
   11 |   while(scanf("%s", s) != EOF)
      |                     ^
main.c:11:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:15: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   15 |           a = pop();
      |               ^~~
      |               popen
main.c:17:11: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   17 |           push(a + b);
      |           ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int get,A[1000];
 
void push(int x){
  /*topを加算してからその位置へ挿入*/
  A[++get]=x;
}
 
int pop(){
  get--;
  /*topが指していた要素を返す*/ 
  return A[get+1];
}
 
int main(){
  int x=0,y=0;
  top=0;
  char a[100];
 
  while(scanf("%s",a)!=EOF){
    if(a[0]=='+'){
      x=pop();
      y=pop();
      push(y+x);
    }else if(a[0]=='-'){
      x=pop();
      y=pop();
      push(y-x);
    }else if(a[0]=='*'){
      x=pop();
      y=pop();
      push(x*y);
    }else {
      push(atoi(a)); 
    }
  }
 
  printf("%d\n",pop());
 
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:19:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
   19 |   top=0;
      |   ^~~
      |   pop
main.c:19:3: 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>

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

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

int top=0;
int S[100];

int main(){
  char S[100];
  int top=0;
  int value1,value2;
 
  while(scanf("%s",S)!=EOF){
    
    if(S[0]=='+'){
      value1=pop();
      value2=pop();
      push(value1+value2);
    }
    else if(S[0]=='-'){
      value1=pop();
      value2=pop();
      push(value1-value2);

    }
    else if(S[0]=='*'){
      value1=pop();
      value2=pop();
      push(value1*value2);

    }
    else{
      push(atoi(S));
    }    
  }
 
  printf("%d\n",pop());

  return 0;
}



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

#include<stdio.h>

int main(){
    char stack[];
    int i, j, k = 0, l = 0, flag = 0;
    scanf("%s", stack);
    while(stack[n] != '\0'){
        n++;
    }
    for(i = 0; i < n; i++){//*42 +43 -45
        if(flag == 0){
            if(stack[i] == 43){
                for(j = k; j < i; j++){//from k to i
                    sum[l] += stack[j];
                }
                k = i + 1;
                l++;
                flag = 1;
            }
            else if(stack[i] == 45){
                sum[l] == stack[k];
                for(j = k + 1; j < i; j++){
                    sum[l] -= stack[j];
                }
                k = i + 1;
                l++;
                flag = 1;
            }
            else if(stack[i] == 42){
                for(j = k; j < i; j++){//from k to i
                    sum[l] *= stack[j];
                }
                k = i + 1;
                l++;
                flag = 1;
            }
            else{
                flag = 0;
            }
        }
        else{
            for(j = 0; j < l; j++){
                highsum[j] = sum[j];
            }
            if(stack[i] == 43){
                for(j = m; j < l; j++){//from k to i
                    sum[0] += highsum[j];
                }
                l = 0;
                flag = 1;
            }
            else if(stack[i] == 45){
                sum[l] == stack[k];
                for(j = k + 1; j < i; j++){
                    sum[l] -= stack[j];
                }
                k = i + 1;
                l++;
                flag = 1;
            }
            else if(stack[i] == 42){
                for(j = k; j < i; j++){//from k to i
                    sum[l] *= stack[j];
                }
                k = i + 1;
                l++;
                flag = 1;
            }
            else{
                flag = 0;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:4:10: error: array size missing in 'stack'
    4 |     char stack[];
      |          ^~~~~
main.c:7:17: error: 'n' undeclared (first use in this function)
    7 |     while(stack[n] != '\0'){
      |                 ^
main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:21: error: 'sum' undeclared (first use in this function)
   14 |                     sum[l] += stack[j];
      |                     ^~~
main.c:43:17: error: 'highsum' undeclared (first use in this function)
   43 |                 highsum[j] = sum[j];
      |                 ^~~~~~~
main.c:46:25: error: 'm' undeclared (first use in this function)
   46 |                 for(j = m; j < l; j++){//from k to i
      |                         ^
Language: C

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

#define MAXOP 100
#define NUMBER '0'

int getop(char []);
void push(double);
double pop(void);

main()
{
	int type;
	double op2;
	char s[MAXOP];

	while((type = getop(s)) != EOF) {
		switch (type) {
		case NUMBER:
			push(atof(s));
			break;
		case '+':
			push(pop() + pop());
			break;
		case '*':
			push(pop() * pop());
			break;
		case '-':
			op2 = pop();
			push(pop() - op2);
			break;
		case '\n':
			printf("\t%.8g\n", pop());
			break;
		}
	}
	return 0;
}

#define MAXVAL 100

int sp = 0;
double val[MAXVAL];

/*
void push(double f)
{
	if (sp < MAXVAL)
		val[sp++] = f;
}


double pop(void)
{
	if (sp > 0)
		return val[--sp];
}
*/
#include <ctype.h>

int getch(void);
void ungetch(int);

int getop(char s[])
{
	int i, c;

	while ((s[0]= c = getch()) == ' ' || c == '\t')
		;
	s[1] = '\0';
	if (!isdigit(c) && c != '.')
		return c;
	i = 0;
	if (isdigit(c)) 
		while (isdigit(s[++i] = c = getch()))
			;
	if (c == '.') 
		while (isdigit(s[++i] = c = getch()))
			;
	s[i] = '\0';
	if (c != EOF)
		ungetch(c);
	return NUMBER;
}

#define BUFSIZE 100

char buf[BUFSIZE];
int bufp =0;

int getch(void) 
{
	return (bufp > 0) ? buf[--bufp] : getchar();
}

void ungetch(int c)
{
	if (bufp >= BUFSIZE)
		printf("ungetch: too many characters\n");
	else
		buf[bufp++] = c;
}



Compiler output:
main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
   12 | main()
      | ^~~~
Language: C

{
  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++;
      }

      // オペランドなら2項を計算する
    } 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;
      case '/':
        a = pop();
        b = pop();
        if (a == 0) break;
        push(b/a);
        break;
      case '%':
        a = pop();
        b = pop();
        if (a == 0) break;
        push(b%a);
      }
      s++;
    }
  }
  return pop();
}

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


Compiler output:
main.c:1:1: error: expected identifier or '(' before '{' token
    1 | {
      | ^
main.c: In function 'main':
main.c:57:10: error: 'MAX_LEN' undeclared (first use in this function)
   57 |   char s[MAX_LEN];
      |          ^~~~~~~
main.c:57:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:58:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   58 |   scanf("%[^\n]*s", s);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | {
main.c:58:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   58 |   scanf("%[^\n]*s", s);
      |   ^~~~~
main.c:58:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:59:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   59 |   printf("%d\n", calc_rpn(s));
      |   ^~~~~~
main.c:59:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:59:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:59:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:59:18: error: implicit declaration of function 'calc_rpn' [-Wimplicit-function-declaration]
   59 |   printf("%d\n", calc_rpn(s));
      |                  ^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000

int S[MAX];
int top=0;

void initialize(){
   top = 0;
 }

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

 void push(int x){
   if(isFull()==0){
     fprintf(stderr,"Push ERROR\n");
     exit(1);
   }
   top++;
   S[top] = x;_
}

int pop(){
    if (isEmpty()==0){
      fprintf(stderr,"Pop ERROR\n");
      exit(2);
    }
      top--;
      return S[top+1];
}

int main(void){
  int num, Masato1, Masato2, N;
  char C[100];

  initialize();

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

    if('1'<=C[0]&&C[0]<='9')num=1;
    else if(C[0]=='+')num=2;
    else if(C[0]=='-')num=3;
    else if(C[0]=='*')num=4;
    else {
      fprintf(stderr,"Input ERROR\n");
      exit(3);
    }
    switch(num){
      case 1:/*数字*/
      N=atoi(C);
      push(N);
      break;

      case 2:/*足し算*/
      Masato1=pop();
      Masato2=pop();
      push(Masato1+Masato2);
      break;

      case 3:/*引き算*/
      Masato2=pop();
      Masato1=pop();
      push(Masato1-Masato2);
      break;

      case 4:/*掛け算*/
      Masato1=pop();
      Masato2=pop();
      push(Masato1*Masato2);
      break;
    }
    Masato1=0;
    Masato2=0;
  }
  printf("%d\n",pop());

  return 0;
}


Compiler output:
main.c: In function 'push':
main.c:28:15: error: '_' undeclared (first use in this function)
   28 |    S[top] = x;_
      |               ^
main.c:28:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:16: error: expected ';' before '}' token
   28 |    S[top] = x;_
      |                ^
      |                ;
   29 | }
      | ~
Language: C

include<stdio.h>
void stack(char);
int calc(char,int []);
int cnt=0;
int cnt2;
int st[3]={0,0,0};
int main(){
  char t;
  int value;
  while((t=getchar())!='\n'){
    if(t!=' ')stack(t);
  }
  printf("%d\n",st[0]);
  return 0;
}
void stack(char l){
  if(l<='9'&&l>='1'){
    if(cnt==0){
      st[0]=l-'0';
      cnt=1;
      cnt2=0;
    }
    else if(cnt2==0){
      st[1]=l-'0';
      cnt2=1;
    }
    else{
      st[2]=l-'0';
      cnt2=0;
    }
  }
  else if(cnt2!=0){
    st[0]=calc(l,st);
    cnt2=0;
  }
  else {
    st[1]=calc(l,st);
    cnt2=1;
  }
}
int calc (char c,int l[]){
  if(c=='+'){
    if(cnt2==1)return l[0]+l[1];
    else return l[1]+l[2];
  }
  else if(c=='-'){
    if(cnt2==1)return l[0]-l[1];
    else return l[1]-l[2];
  }
  else if(c=='*'){
    if(cnt2==1)return l[0]*l[1];
    else return l[1]*l[2];
  }
}



Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:10:12: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
   10 |   while((t=getchar())!='\n'){
      |            ^~~~~~~
main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:15: error: implicit declaration of function 'stack' [-Wimplicit-function-declaration]
   11 |     if(t!=' ')stack(t);
      |               ^~~~~
main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",st[0]);
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:16:6: warning: conflicting types for 'stack'; have 'void(char)'
   16 | void stack(char l){
      |      ^~~~~
main.c:11:15: note: previous implicit declaration of 'stack' with type 'void(char)'
   11 |     if(t!=' ')stack(t);
      |               ^~~~~
Language: C

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

#define MAX 100

void push(int);
int pop(void);
int change(char c);

int p = 0;
int stack[MAX + 1];

int main(){

  int data1, data2;
  char c;

  while(1)
    {
      c = getchar();
      if(c == '\n'){
	  printf(" %d\n",pop());
	  break;
	}
      else if('0' <= c && c <= '9'){
	  push(dtoi(c));
	}
      else{
	  data1 = pop();
    data2 = pop();

   if(c=='+') push(data1 + data2);
   else if(c=='-') push(data1 - data2);
   else if(c=='*') push(data1 * data2);
   else if(c=='/') push(data1 / data2);

 }
   }
 return 0;
}

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

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

int change(char c){
  char str[2];
  str[0]=c;
  str[1]='\0';
  return atoi(str);
}



Compiler output:
main.c: In function 'main':
main.c:26:16: error: implicit declaration of function 'dtoi'; did you mean 'atoi'? [-Wimplicit-function-declaration]
   26 |           push(dtoi(c));
      |                ^~~~
      |                atoi
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: In function 'main':
main.c:35:17: error: expected expression before '}' token
   35 |                 }
      |                 ^
main.c:34:25: error: void value not ignored as it ought to be
   34 |                         push(atoi(s))+
      |                         ^~~~~~~~~~~~~
Language: C

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

int top,S[1000];

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

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: In function 'main':
main.c:14:16: error: expected expression before '[' token
   14 |         char s=[100];
      |                ^
main.c:16:21: error: subscripted value is neither array nor pointer nor vector
   16 |                 if(s[0]=='+'){
      |                     ^
main.c:17:27: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   17 |                         a=pop();
      |                           ^~~
      |                           popen
main.c:20:27: error: subscripted value is neither array nor pointer nor vector
   20 |                 }else if(s[0]=='-'){
      |                           ^
main.c:24:27: error: subscripted value is neither array nor pointer nor vector
   24 |                 }else if(s[0]=='*'){
      |                           ^
main.c:29:35: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   29 |                         push(atoi(s));
      |                                   ^
      |                                   |
      |                                   char
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'char'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
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: In function 'main':
main.c:22:16: error: expected expression before '[' token
   22 |         char s=[100];
      |                ^
main.c:24:21: error: subscripted value is neither array nor pointer nor vector
   24 |                 if(s[0]=='+'){
      |                     ^
main.c:28:27: error: subscripted value is neither array nor pointer nor vector
   28 |                 }else if(s[0]=='-'){
      |                           ^
main.c:32:27: error: subscripted value is neither array nor pointer nor vector
   32 |                 }else if(s[0]=='*'){
      |                           ^
main.c:37:35: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   37 |                         push(atoi(s));
      |                                   ^
      |                                   |
      |                                   char
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'char'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

void initialize(void);
int isEmpty(void);
int isFull(void);
void push(int);
int pop(void);

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

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

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

  return 0;
}
void push(int x){
  if (isFull()==1){
    printf("error(overflow)");
  }else{
  top++;
  S[top] = x;
  }
}
int pop(void){
  if(isEmpty()==1){
    printf("error(underflow)");
  }else{
    top--;
    return S[top+1];
  }
}



Compiler output:
main.c:8:7: error: 'MAX' undeclared here (not in a function)
    8 | int S[MAX];
      |       ^~~
main.c: In function 'main':
main.c:13:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |   while( scanf("%s", s) != EOF ){
      |          ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void initialize(void);
main.c:13:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |   while( scanf("%s", s) != EOF ){
      |          ^~~~~
main.c:13:10: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:28: error: 'EOF' undeclared (first use in this function)
   13 |   while( scanf("%s", s) != EOF ){
      |                            ^~~
main.c:13:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:13:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   27 |       x = atoi(s);
      |           ^~~~
main.c:31:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   31 |   printf("%d\n",S[top]);
      |   ^~~~~~
main.c:31:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:31:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:31:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'push':
main.c:52:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   52 |     printf("error(overflow)");
      |     ^~~~~~
main.c:52:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'pop':
main.c:60:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   60 |     printf("error(underflow)");
      |     ^~~~~~
main.c:60:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

#define O 100
#define E 99
#define N 1000000

int main()
{
  int i=0,j=0,cnt = 0,a[O]={0},A[O]={0};
  char Data[O];
  
  while(scanf("%s",Data) != EOF)
    {
      if((a[i] = atoi(Data)) == 0)
	{
	  if(cnt == 1)
	    {
	      a[0] = A[j-2];
	      a[1] = A[j-1];
	      cnt = 0;
	    }
	  switch(Data[0])
	    {
	    case '+':
	      A[j] = a[0] + a[1];
	      break;
	      
	    case '-':
	      A[j] = a[0] - a[1];
	      break;
	      
	    case '*':
	      A[j] = a[0] * a[1];
	      break;
		  
	    default:
	      break;
	    }
	  
	  a[0] = 0;
	  a[1] = 0;
	  i = 0;
	  j++;
	  cnt++;
	}
      else
	{
	  i++;
	  if(cnt == 1) cnt = 0;
	}
    }

  printf("%d\n"A[j-1]);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:54:16: error: expected ')' before 'A'
   54 |   printf("%d\n"A[j-1]);
      |         ~      ^
      |                )
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: In function 'main':
main.c:39:22: error: request for member 'pop' in something not a structure or union
   39 |         printf("%d\n". pop());
      |                      ^
Language: C

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

int top,S[1000];

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

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


Compiler output:
main.c: In function 'main':
main.c:34:30: error: implicit declaration of function 'stoi'; did you mean 'atoi'? [-Wimplicit-function-declaration]
   34 |                         push(stoi(s));
      |                              ^~~~
      |                              atoi
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--;
rerturn S[top+1];
}

int main() {
int a, b;
top = 0;
char s[100];
 while( scanf("%s", s) != EOF ) {
if ( s[0] == '+7 ) {
a = pop();
b = pop();
push(a + b);
}else if ( s[0] == '-7 ) {
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: In function 'pop':
main.c:14:1: error: unknown type name 'rerturn'
   14 | rerturn S[top+1];
      | ^~~~~~~
main.c: In function 'main':
main.c:22:14: warning: missing terminating ' character
   22 | if ( s[0] == '+7 ) {
      |              ^
main.c:22:14: error: missing terminating ' character
   22 | if ( s[0] == '+7 ) {
      |              ^~~~~~~
main.c:23:3: error: lvalue required as left operand of assignment
   23 | a = pop();
      |   ^
main.c:23:10: error: expected ')' before ';' token
   23 | a = pop();
      |          ^
      |          )
main.c:22:4: note: to match this '('
   22 | if ( s[0] == '+7 ) {
      |    ^
main.c:26:1: error: expected expression before '}' token
   26 | }else if ( s[0] == '-7 ) {
      | ^
main.c:26:2: error: 'else' without a previous 'if'
   26 | }else if ( s[0] == '-7 ) {
      |  ^~~~
main.c:26:20: warning: missing terminating ' character
   26 | }else if ( s[0] == '-7 ) {
      |                    ^
main.c:26:20: error: missing terminating ' character
   26 | }else if ( s[0] == '-7 ) {
      |                    ^~~~~~~
main.c:27:3: error: lvalue required as left operand of assignment
   27 | b = pop();
      |   ^
main.c:27:10: error: expected ')' before ';' token
   27 | b = pop();
      |          ^
      |          )
main.c:26:10: note: to match this '('
   26 | }else if ( s[0] == '-7 ) {
      |          ^
main.c:30:1: error: expected expression before '}' token
   30 | } else if ( s[0] == '*' ) {
      | ^
main.c: At top level:
main.c:30:3: error: expected identifier or '(' before 'else'
   30 | } else if ( s[0] == '*' ) {
      |   ^~~~
main.c:34:3: error: expected identifier or '(' before 'else'
   34 | } else {
      |   ^~~~
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | }
      | ^
main.c:39:8: error: expected declaration specifiers or '...' before string constant
   39 | printf("%d\n", pop());
      |        ^~~~~~
main.c:39:16: error: expected declaration specifiers or '...' before 'pop'
   39 | printf("%d\n", pop());
      |                ^~~
main.c:41:1: error: expected identifier or '(' before 'return'
   41 | return 0;
      | ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
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(atio(s));
		}
	}
	
	printf("%d\n", pop());
	
	return 0;
	
}


Compiler output:
main.c: In function 'main':
main.c:35:30: error: implicit declaration of function 'atio'; did you mean 'atoi'? [-Wimplicit-function-declaration]
   35 |                         push(atio(s));
      |                              ^~~~
      |                              atoi
Language: C

string.h>
int top,S[1000];

int push(int x){
  S[++top]=x;
  //notS[top++] sがゼロの時に処理してしまうから

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

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

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

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

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

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

    return 0;
}



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

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

	/* a to i(atoi)…aをiに変換する*/
	/*stdlibにあるのでそれを使う*/
	
#include  <string.h>

int top, S[ 1000 ];

void push( int x ){

	top ++; 
	/*top空だと0なので最初に1増やしておいてその増やした場所にxを入れる*/
	/*1増やして処理する*/
	
	S [ top ] = x;
	
	/* S[top++]はダメ*/
	/*処理をしてから1増える*/
}

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

int main (void){
		int a,b;
	top = 0;
	/*topの初期化（空を示す）*/
	char s [ 100 ];
	/*キーボードからの入力用*/
	
	while ( scanf("%s",s) != EOF )
	/*while文に使われている、scanfの戻り値の解説*/
	/*戻り値は入力に成功した入力項目の数が返される*/
	
		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:56:17: error: expected declaration specifiers or '...' before string constant
   56 |         printf( "%d\n",pop());
      |                 ^~~~~~
main.c:56:24: error: expected declaration specifiers or '...' before 'pop'
   56 |         printf( "%d\n",pop());
      |                        ^~~
main.c:57:9: error: expected identifier or '(' before 'return'
   57 |         return 0;
      |         ^~~~~~
main.c:58:1: error: expected identifier or '(' before '}' token
   58 | }
      | ^
Language: C

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

int top, S[1000];

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

int main (void){
		int a,b;
	top = 0;
	char s [ 100 ];
	while ( scanf("%s",s) != EOF )
	
		if( s[0] == '+' ){
			a = pop();
			b = pop();
			push ( a + b );
		} else if (s[0] == '-'){
			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:39:17: error: expected declaration specifiers or '...' before string constant
   39 |         printf( "%d\n",pop());
      |                 ^~~~~~
main.c:39:24: error: expected declaration specifiers or '...' before 'pop'
   39 |         printf( "%d\n",pop());
      |                        ^~~
main.c:40:9: error: expected identifier or '(' before 'return'
   40 |         return 0;
      |         ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C

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

int pop(){
  return N[--i];
}

int main(){

  int N[100];
  char s[10];
  int i;

  while(scanf("%s",s)!=EOF){
 
    if(a[0]=='+')N[i++]=(pop()+pop());
    
    else if(a[0]=='-'){
      n1=pop();
      n2=pop();
      N[i++]=n2-n1;
    }
    else if(a[0]=='*')N[i++]=(pop()*pop());
    else N[i++]=atoi[s];
  }
  printf("%d\n",st[0]);
  return 0;
}
  



Compiler output:
main.c: In function 'pop':
main.c:5:10: error: 'N' undeclared (first use in this function)
    5 |   return N[--i];
      |          ^
main.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:14: error: 'i' undeclared (first use in this function)
    5 |   return N[--i];
      |              ^
main.c: In function 'main':
main.c:16:8: error: 'a' undeclared (first use in this function)
   16 |     if(a[0]=='+')N[i++]=(pop()+pop());
      |        ^
main.c:19:7: error: 'n1' undeclared (first use in this function)
   19 |       n1=pop();
      |       ^~
main.c:20:7: error: 'n2' undeclared (first use in this function)
   20 |       n2=pop();
      |       ^~
main.c:24:21: error: array subscript is not an integer
   24 |     else N[i++]=atoi[s];
      |                     ^
main.c:26:17: error: 'st' undeclared (first use in this function); did you mean 's'?
   26 |   printf("%d\n",st[0]);
      |                 ^~
      |                 s