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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
char str[1000];
int a,b,ans,num[1000],kotae;
gets(str);
int str_size=strlen(str);
for(int i=0;i<str_size;i++){
if(str[i]=='-')
{
a=pop();
b=pop();
ans=b-a;
push(ans);
}
else if(str[i]=='+')
{
a=pop();
b=pop();
ans=b+a;
push(ans);
}
else if(str[i]=='*')
{
a=pop();
b=pop();
ans=b*a;
push(ans);
}
else if(str[i]==' ')
{
continue;
}
else {
num[i]=atoi(str[i]);
push(num[i]);
kotae=pop();
}
}
printf("%d\n",kotae);





}



Compiler output:
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 | gets(str);
      | ^~~~
      | fgets
main.c:12:3: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
   12 | a=pop();
      |   ^~~
      |   popen
main.c:15:1: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   15 | push(ans);
      | ^~~~
main.c:36:16: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   36 | num[i]=atoi(str[i]);
      |             ~~~^~~
      |                |
      |                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>

int top;
int S[1000];
// stack!!

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


 int main(){
 char s[100];
 int a,b;
 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 'init':
main.c:8:11: error: expected ';' before '}' token
    8 |    top = 0
      |           ^
      |           ;
    9 |  }
      |  ~         
main.c: In function 'main':
main.c:39:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   39 |      push(atoi(s));
      |           ^~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char character;
    int ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' < ch && ch < '9' )
        {
            character = ch;
            push(atoi(&character));
        }
        else if( ch != ' ' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_1 + operand_2;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_1 * operand_2;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
    }

    printf("%d", result);

    return 0;

}

// スタックを作成する関数
void create_stack(void)
{
    int i;

    for(i = 0; i < Max_Stack; i++)
    {
        // スタックの初期化
        ary_stack[i] = 0;
    }

    return;
}

// スタックへプッシュする関数
int push(int element)
{

    if( stack_count > Max_Stack )
    {
        // サイズオーバー
        return -1;
    }

    // スタックに追加する
    ary_stack[++stack_count] = element;

    return 0;
}

// スタックからポップする関数
int pop(void)
{
    int ret = 0;

    if( stack_count < 0 )
    {
        // スタックが空の時
        ret = INT_MIN;
    }
    else
    {
        ret = ary_stack[stack_count--];
    }

    return ret;
}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char character;
    int ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' < ch && ch < '9' )
        {
            character = ch;
            push(atoi(&character));
        }
        else if( ch != ' ' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_1 + operand_2;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_1 * operand_2;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
    }

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

    return 0;

}

// スタックを作成する関数
void create_stack(void)
{
    int i;

    for(i = 0; i < Max_Stack; i++)
    {
        // スタックの初期化
        ary_stack[i] = 0;
    }

    return;
}

// スタックへプッシュする関数
int push(int element)
{

    if( stack_count > Max_Stack )
    {
        // サイズオーバー
        return -1;
    }

    // スタックに追加する
    ary_stack[++stack_count] = element;

    return 0;
}

// スタックからポップする関数
int pop(void)
{
    int ret = 0;

    if( stack_count < 0 )
    {
        // スタックが空の時
        ret = INT_MIN;
    }
    else
    {
        ret = ary_stack[stack_count--];
    }

    return ret;
}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char character;
    int ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' < ch && ch < '9' )
        {
            character = ch;
            push(atoi(&character));
        }
        else if( ch != ' ' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
    }

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

    return 0;

}

// スタックを作成する関数
void create_stack(void)
{
    int i;

    for(i = 0; i < Max_Stack; i++)
    {
        // スタックの初期化
        ary_stack[i] = 0;
    }

    return;
}

// スタックへプッシュする関数
int push(int element)
{

    if( stack_count > Max_Stack )
    {
        // サイズオーバー
        return -1;
    }

    // スタックに追加する
    ary_stack[++stack_count] = element;

    return 0;
}

// スタックからポップする関数
int pop(void)
{
    int ret = 0;

    if( stack_count < 0 )
    {
        // スタックが空の時
        //ret = INT_MIN;
    }
    else
    {
        ret = ary_stack[stack_count--];
    }

    return ret;
}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char str[10];
    int i = 0, ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' <= ch && ch <= '9' )
        {
            str[i++] = ch;
        }
        else if( ch == '+' || ch == '-' || ch == '*' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
        else if( str[0] != '\0' )
        {
            str[i] = '\0';
            // 数値をプッシュする
            push(atoi(&str[0]));
            // 初期化をする
            i = 0;
            str[0] = '\0';
        }
    }

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

    return 0;

}

// スタックを作成する関数
void create_stack(void)
{
    int i;

    for(i = 0; i < Max_Stack; i++)
    {
        // スタックの初期化
        ary_stack[i] = 0;
    }

    return;
}

// スタックへプッシュする関数
int push(int element)
{

    if( stack_count > Max_Stack )
    {
        // サイズオーバー
        return -1;
    }

    // スタックに追加する
    ary_stack[++stack_count] = element;

    return 0;
}

// スタックからポップする関数
int pop(void)
{
    int ret = 0;

    if( stack_count < 0 )
    {
        // スタックが空の時
        ret = INT_MIN;
    }
    else
    {
        ret = ary_stack[stack_count--];
    }

    return ret;
}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char str[10];
    int i = 0, ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' <= ch && ch <= '9' )
        {
            str[i++] = ch;
        }
        else if( ch == '+' || ch == '-' || ch == '*' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
        else if( str[0] != '\0' )
        {
            str[i] = '\0';
            // 数値をプッシュする
            push(atoi(&str[0]));
            // 初期化をする
            i = 0;
            str[0] = '\0';
        }
    }

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

    return 0;

}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char str[10];
    int i = 0, ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' <= ch && ch <= '9' )
        {
            str[i++] = ch;
        }
        else if( ch == '+' || ch == '-' || ch == '*' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
        else if( str[0] != '\0' )
        {
            str[i] = '\0';
            // 数値をプッシュする
            //push(atoi(&str[0]));
            // 初期化をする
            i = 0;
            str[0] = '\0';
        }
    }

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

    return 0;

}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char str[10];
    int i = 0, ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' <= ch && ch <= '9' )
        {
            str[i++] = ch;
        }
        else if( ch == '+' || ch == '-' || ch == '*' )
        {
            //operand_1 = pop();
            //operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 次の計算に備えて、結果をpushしておく
            push(result);
        }
        else if( str[0] != '\0' )
        {
            str[i] = '\0';
            // 数値をプッシュする
            //push(atoi(&str[0]));
            // 初期化をする
            i = 0;
            str[0] = '\0';
        }
    }

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

    return 0;

}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

// スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

// スタック関連の定義
const int Max_Stack = 1000;
int stack_pointer = 0;
int ary_stack[Max_Stack];

void create_stack(void);
int push(int element);
int pop(void);

int main(void)
{
    char str[10];
    int i = 0, ch, operand_1, operand_2;
    int result;

    // スタックを作成
    create_stack();

    while( ( ch = getchar() ) != '\n' )
    {

        if( '0' <= ch && ch <= '9' )
        {
            str[i++] = ch;
        }
        else if( ch == '+' || ch == '-' || ch == '*' )
        {
            operand_1 = pop();
            operand_2 = pop();

            if( ch == '+' )
            {
                result = operand_2 + operand_1;
            }
            else if( ch == '-' )
            {
                result = operand_2 - operand_1;
            }
            if( ch == '*' )
            {
                result = operand_2 * operand_1;
            }

            // 演算結果をpushしておく
            push(result);
        }
        else if( str[0] != '\0' )
        {
            str[i] = '\0';

            // 数値をプッシュする
            push(atoi(&str[0]));

            // 初期化をする
            i = 0;
            str[0] = '\0';
        }
    }

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

    return 0;

}

// スタックを作成する関数
void create_stack(void)
{
    int i;

    for(i = 0; i < Max_Stack; i++)
    {
        // スタックの初期化
        ary_stack[i] = 0;
    }

    return;
}

// スタックへプッシュする関数
int push(int element)
{

    if( stack_pointer > Max_Stack )
    {
        // サイズオーバー
        return -1;
    }

    // スタックに追加する
    ary_stack[++stack_pointer] = element;

    return 0;
}

// スタックからポップする関数
int pop(void)
{
    int ret = 0;

    if( stack_pointer < 0 )
    {
        // スタックが空の時
        //ret = INT_MIN;
    }
    else
    {
        ret = ary_stack[stack_pointer--];
    }

    return ret;
}



Compiler output:
main.c:11:5: error: variably modified 'ary_stack' at file scope
   11 | int ary_stack[Max_Stack];
      |     ^~~~~~~~~
Language: C

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

class Stack
{
public:
	void push(int x)
	{
		++myTop;
		myData[myTop] = x;
	}
	void pop()
	{
		--myTop;
	}
	int top()
	{
		int nTemp = myData[myTop];
		return nTemp;
	}
private:
	int myTop = 0;
	int myData[1000] = { 0 };
};


int main()
{
	char chIn[100] = { '\0' };
	Stack staIn;
	int nTemp = 0;
	int na = 0, nb = 0;

	while (scanf_s("%s", chIn, 100))
	{
		if (chIn[0] - '0' <= 9 && chIn[0] - '0' >= 0)
		{
			nTemp = atoi(chIn);
			staIn.push(nTemp);
		}
		else
		{
			nb = staIn.top();
			staIn.pop();
			na = staIn.top();
			staIn.pop();
			switch (chIn[0])
			{
			case '-':
				staIn.push(na - nb);
				break;
			case '+':
				staIn.push(na + nb);
				break;
			case '*':
				staIn.push(na * nb);
				break;
			}
		}
	}
	int nout = staIn.top();
	printf("%d\n", staIn.top());
	return 0;
}


Compiler output:
main.c:5:1: error: unknown type name 'class'
    5 | class Stack
      | ^~~~~
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    6 | {
      | ^
main.c: In function 'main':
main.c:31:9: error: unknown type name 'Stack'
   31 |         Stack staIn;
      |         ^~~~~
main.c:35:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   35 |         while (scanf_s("%s", chIn, 100))
      |                ^~~~~~~
      |                scanf
main.c:40:30: error: request for member 'push' in something not a structure or union
   40 |                         staIn.push(nTemp);
      |                              ^
main.c:44:35: error: request for member 'top' in something not a structure or union
   44 |                         nb = staIn.top();
      |                                   ^
main.c:45:30: error: request for member 'pop' in something not a structure or union
   45 |                         staIn.pop();
      |                              ^
main.c:46:35: error: request for member 'top' in something not a structure or union
   46 |                         na = staIn.top();
      |                                   ^
main.c:47:30: error: request for member 'pop' in something not a structure or union
   47 |                         staIn.pop();
      |                              ^
main.c:51:38: error: request for member 'push' in something not a structure or union
   51 |                                 staIn.push(na - nb);
      |                                      ^
main.c:54:38: error: request for member 'push' in something not a structure or union
   54 |                                 staIn.push(na + nb);
      |                                      ^
main.c:57:38: error: request for member 'push' in something not a structure or union
   57 |                                 staIn.push(na * nb);
      |                                      ^
main.c:62:25: error: request for member 'top' in something not a structure or union
   62 |         int nout = staIn.top();
      |                         ^
main.c:63:29: error: request for member 'top' in something not a structure or union
   63 |         printf("%d\n", staIn.top());
      |                             ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:22:16: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   22 |       a[top] = atoi(s);
      |                ^~~~
main.c:25:17: error: 'x' undeclared (first use in this function)
   25 |   printf("%d\n",x[1]);
      |                 ^
main.c:25:17: 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>
#include<ctype.h>

#define MAX 200
#define SMAX 1000000
int stack[MAX];
int top=0;

void define_code(void);//0~9,+,-,*,/に対応する文字コードを特定する。
void initialize(void);//topを0にしてスタックを初期化する
int isEmpty(void);//スタックが空なら１を返す
int isFull(void);//スタックが満杯なら１を返す
void push(int push_num);//値をpushする
int pop(void);
void cal(char str);//計算を行う
void stack_input(void);//スタックに値を入れる
//
int main(void)
{
    initialize();
    stack_input();
    printf("%d\n",stack[1]);
    return 0;
}
//
void initialize(void)
{
    top=0;
}
int isEmpty(void)
{
    if(top==0){return 1;}
    else{return 0;}
}
int isFull(void)
{
    if(top>=MAX-1){return 1;}
    else{return 0;} 
}
void push(int push_num)
{
    if (isFull())
    {
        printf("over-flow\n");
        exit(1);
    }
    else
    {
        top++;
        stack[top] = push_num;
        //printf("push:%d\n",push_num);
    }
}
int pop(void)
{
    if(isEmpty())
    {
        printf("under-flow\n");
        exit(1);
    }
    else
    {
        top--;
        //printf("pop:%d\n",stack[top+1]);
        return stack[top+1];
    }
}
void cal(char str)
{
    int x,y;
    x=pop();
    y=pop();
    if(str=='+'){y=y+x;}
    else if(str=='-'){y=y-x;}
    else if(str='*'){y=y*x;}
    push(y);
    
}
void stack_input(void)
{
    char str[SMAX];
    int x;
    gets(str);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            push(x);
        }
        else
        {
            cal(str[i]);
            i++;
        }
    }
}



Compiler output:
main.c: In function 'stack_input':
main.c:85:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   85 |     gets(str);
      |     ^~~~
      |     fgets
Language: C

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

#define MAX 200
#define SMAX 1000000
int stack[MAX];
int top=0;

void define_code(void);//0~9,+,-,*,/に対応する文字コードを特定する。
void initialize(void);//topを0にしてスタックを初期化する
int isEmpty(void);//スタックが空なら１を返す
int isFull(void);//スタックが満杯なら１を返す
void push(int push_num);//値をpushする
int pop(void);
void cal(char str);//計算を行う
void stack_input(void);//スタックに値を入れる
//
int main(void)
{
    initialize();
    stack_input();
    printf("%d\n",stack[1]);
    return 0;
}
//
void initialize(void)
{
    top=0;
}
int isEmpty(void)
{
    if(top==0){return 1;}
    else{return 0;}
}
int isFull(void)
{
    if(top>=MAX-1){return 1;}
    else{return 0;} 
}
void push(int push_num)
{
    if (isFull())
    {
        //printf("over-flow\n");
        exit(1);
    }
    else
    {
        top++;
        stack[top] = push_num;
        //printf("push:%d\n",push_num);
    }
}
int pop(void)
{
    if(isEmpty())
    {
        //printf("under-flow\n");
        exit(1);
    }
    else
    {
        top--;
        //printf("pop:%d\n",stack[top+1]);
        return stack[top+1];
    }
}
void cal(char str)
{
    int x,y;
    x=pop();
    y=pop();
    if(str=='+'){y=y+x;}
    else if(str=='-'){y=y-x;}
    else if(str='*'){y=y*x;}
    push(y);
    
}
void stack_input(void)
{
    char str[SMAX];
    int x;
    gets(str);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            push(x);
        }
        else
        {
            cal(str[i]);
            i++;
        }
    }
}



Compiler output:
main.c: In function 'stack_input':
main.c:85:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   85 |     gets(str);
      |     ^~~~
      |     fgets
Language: C

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

#define MAX 500
#define SMAX 1000000
int stack[MAX];
int top=0;

void define_code(void);//0~9,+,-,*,/に対応する文字コードを特定する。
void initialize(void);//topを0にしてスタックを初期化する
int isEmpty(void);//スタックが空なら１を返す
int isFull(void);//スタックが満杯なら１を返す
void push(int push_num);//値をpushする
int pop(void);
void cal(char str);//計算を行う
void stack_input(void);//スタックに値を入れる
//
int main(void)
{
    initialize();
    stack_input();
    printf("%d\n",stack[1]);
    return 0;
}
//
void initialize(void)
{
    top=0;
}
int isEmpty(void)
{
    if(top==0){return 1;}
    else{return 0;}
}
int isFull(void)
{
    if(top>=MAX-1){return 1;}
    else{return 0;} 
}
void push(int push_num)
{
    if (isFull())
    {
        //printf("over-flow\n");
        exit(1);
    }
    else
    {
        top++;
        stack[top] = push_num;
        //printf("push:%d\n",push_num);
    }
}
int pop(void)
{
    if(isEmpty())
    {
        //printf("under-flow\n");
        exit(1);
    }
    else
    {
        top--;
        //printf("pop:%d\n",stack[top+1]);
        return stack[top+1];
    }
}
void cal(char str)
{
    int x,y;
    x=pop();
    y=pop();
    if(str=='+'){y=y+x;}
    else if(str=='-'){y=y-x;}
    else if(str='*'){y=y*x;}
    push(y);
    
}
void stack_input(void)
{
    char str[SMAX];
    int x;
    gets(str);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            push(x);
        }
        else
        {
            cal(str[i]);
            i++;
        }
    }
}



Compiler output:
main.c: In function 'stack_input':
main.c:85:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   85 |     gets(str);
      |     ^~~~
      |     fgets
Language: C

//16D8101012J 伊藤惇 dj c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>

#define MAX 200
#define SMAX 1000000
int stack[MAX];
int top=0;

void define_code(void);//0~9,+,-,*,/に対応する文字コードを特定する。
void initialize(void);//topを0にしてスタックを初期化する
int isEmpty(void);//スタックが空なら１を返す
int isFull(void);//スタックが満杯なら１を返す
void push(int push_num);//値をpushする
int pop(void);
void cal(char str);//計算を行う
void stack_input(void);//スタックに値を入れる
//
int main(void)
{
    initialize();
    stack_input();
    printf("%d\n",stack[1]);
    return 0;
}
//
void initialize(void)
{
    top=0;
}
int isEmpty(void)
{
    if(top==0){return 1;}
    else{return 0;}
}
int isFull(void)
{
    if(top>=MAX-1){return 1;}
    else{return 0;} 
}
void push(int push_num)
{
    if (isFull())
    {
        //printf("over-flow\n");
        exit(1);
    }
    else
    {
        top++;
        stack[top] = push_num;
        //printf("push:%d\n",push_num);
    }
}
int pop(void)
{
    if(isEmpty())
    {
        //printf("under-flow\n");
        exit(1);
    }
    else
    {
        top--;
        //printf("pop:%d\n",stack[top+1]);
        return stack[top+1];
    }
}
void cal(int str)
{
    int x,y;
    x=pop();
    y=pop();
    if(str=='+'){y=y+x;}
    else if(str=='-'){y=y-x;}
    else if(str='*'){y=y*x;}
    push(y);
    
}
void stack_input(void)
{
    char str[SMAX];
    int x;
    gets(str);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            push(x);
        }
        else
        {
            cal(str[i]);
            i++;
        }
    }
}



Compiler output:
main.c:71:6: error: conflicting types for 'cal'; have 'void(int)'
   71 | void cal(int str)
      |      ^~~
main.c:18:6: note: previous declaration of 'cal' with type 'void(char)'
   18 | void cal(char str);//計算を行う
      |      ^~~
main.c: In function 'stack_input':
main.c:86:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   86 |     gets(str);
      |     ^~~~
      |     fgets
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(void){
	char str[100];
	gets(str);
	int i = strlen(str);
	int now; //入力の番号
	int stacknum=0; 
	int stack[100];
//	printf("入力された文字列は：%s\n%d\n", str, i);
	
	for(now=0; now<i; now++){
		//printf("入力された文字列は：%c\n",str[now]);
		
		if(str[now]=='+'){
			stack[stacknum-2]=stack[stacknum-2]+stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'+');
		}else if(str[now]=='-'){
			stack[stacknum-2]=stack[stacknum-2]-stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'-');
		}else if(str[now]=='*'){
			stack[stacknum-2]=stack[stacknum-2]*stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'*');
		}else{
			stack[stacknum]=str[now]-'0';
			stacknum++;
		}
		now++;
	}
	printf("%d",stack[stacknum-1]);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    5 |         gets(str);
      |         ^~~~
      |         fgets
main.c:6:17: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    6 |         int i = strlen(str);
      |                 ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | int main(void){
main.c:6:17: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    6 |         int i = strlen(str);
      |                 ^~~~~~
main.c:6:17: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
	char str[100];
	gets(str);
	int i = strlen(str);
	int now; //入力の番号
	int stacknum=0; 
	int stack[100];
//	printf("入力された文字列は：%s\n%d\n", str, i);
	
	for(now=0; now<i; now++){
		//printf("入力された文字列は：%c\n",str[now]);
		
		if(str[now]=='+'){
			stack[stacknum-2]=stack[stacknum-2]+stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'+');
		}else if(str[now]=='-'){
			stack[stacknum-2]=stack[stacknum-2]-stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'-');
		}else if(str[now]=='*'){
			stack[stacknum-2]=stack[stacknum-2]*stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'*');
		}else{
			stack[stacknum]=str[now]-'0';
			stacknum++;
		}
		now++;
	}
	printf("%d",stack[stacknum-1]);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |         gets(str);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
	char str[100];
	gets(str);
	int i = strlen(str);
	int now; //入力の番号
	int stacknum=0; 
	int stack[100];
//	printf("入力された文字列は：%s\n%d\n", str, i);
	
	for(now=0; now<i; now++){
		//printf("入力された文字列は：%c\n",str[now]);
		
		if(str[now]=='+'){
			stack[stacknum-2]=stack[stacknum-2]+stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'+');
		}else if(str[now]=='-'){
			stack[stacknum-2]=stack[stacknum-2]-stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'-');
		}else if(str[now]=='*'){
			stack[stacknum-2]=stack[stacknum-2]*stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'*');
		}else{
			stack[stacknum]=str[now]-'0';
			stacknum++;
		}
		now++;
	}
	printf("%d\n",stack[stacknum-1]);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |         gets(str);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
	char str[100];
	gets(str);
	int i = strlen(str);
	int now; //入力の番号
	int stacknum=0; 
	int stack[100];
//	printf("入力された文字列は：%s\n%d\n", str, i);
	
	for(now=0; now<i; now++){
		//printf("入力された文字列は：%c\n",str[now]);
		
		if(str[now]=='+'){
			stack[stacknum-2]=stack[stacknum-2]+stack[stacknum-1];
			stacknum=stacknum-1;
			//printf("入力された文字列は：%c\n",'+');
		}else if(str[now]=='-'){
			stack[stacknum-2]=stack[stacknum-2]-stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'-');
		}else if(str[now]=='*'){
			stack[stacknum-2]=stack[stacknum-2]*stack[stacknum-1];
			stacknum=stacknum-1;
		//	printf("入力された文字列は：%c\n",'*');
		}else{
			stack[stacknum]=str[now]-'0';
			stacknum++;
		}
		now++;
	}
	printf("%d",stack[stacknum-1]);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |         gets(str);
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>

int STACK 100;

sturuct stack{
    int num;
    int data[STACK];
}typedef struct stack S;

int main(void){
    
}


Compiler output:
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
    3 | int STACK 100;
      |           ^~~
main.c:5:1: error: unknown type name 'sturuct'; did you mean 'struct'?
    5 | sturuct stack{
      | ^~~~~~~
      | struct
main.c:5:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | sturuct stack{
      |              ^
Language: C

#include<stdio.h>

int STACK 100;

sturuct stack{
    int num;
    int data[STACK];
};typedef struct stack S;

int main(void){
    
}


Compiler output:
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
    3 | int STACK 100;
      |           ^~~
main.c:5:1: error: unknown type name 'sturuct'; did you mean 'struct'?
    5 | sturuct stack{
      | ^~~~~~~
      | struct
main.c:5:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | sturuct stack{
      |              ^
Language: C

#include<stdio.h>
#define SIZE 100
int stack[SIZE];
int n=0;

void push(int x){
    if(n<SIZE){
        n++;
        stack[n]=x;
    }
}
int pop(int x){
   return stack[--n]; 
}
int main(void){
    int c,x,a,b;
    
    while((c=getchar())!=EOF){
        if(isdigit(c)){
            ungetc(c,stdin);
            scanf("%d",&x);
            push(x);
        }else{
            switch(c){
                case '+':
                push(pop()+pop());
                break;
                case '-':
                b=pop();
                a=pop();
                push(a-b);
                break;
                case '*':
                push(a:b);
                break;
                case ' ':
                break;
                case '\n':
                printf("%d",pop());
                break;
                default:
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:19:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   19 |         if(isdigit(c)){
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include<stdio.h>
  +++ |+#include <ctype.h>
    2 | #define SIZE 100
main.c:26:22: error: too few arguments to function 'pop'
   26 |                 push(pop()+pop());
      |                      ^~~
main.c:12:5: note: declared here
   12 | int pop(int x){
      |     ^~~
main.c:26:28: error: too few arguments to function 'pop'
   26 |                 push(pop()+pop());
      |                            ^~~
main.c:12:5: note: declared here
   12 | int pop(int x){
      |     ^~~
main.c:29:19: error: too few arguments to function 'pop'
   29 |                 b=pop();
      |                   ^~~
main.c:12:5: note: declared here
   12 | int pop(int x){
      |     ^~~
main.c:30:19: error: too few arguments to function 'pop'
   30 |                 a=pop();
      |                   ^~~
main.c:12:5: note: declared here
   12 | int pop(int x){
      |     ^~~
main.c:34:23: error: expected ')' before ':' token
   34 |                 push(a:b);
      |                     ~ ^
      |                       )
main.c:39:29: error: too few arguments to function 'pop'
   39 |                 printf("%d",pop());
      |                             ^~~
main.c:12:5: note: declared here
   12 | int pop(int x){
      |     ^~~
Language: C

#include<stdio.h>
#define SIZE 100
int stack[SIZE];
int n=0;

void push(int x){
    if(n<SIZE){
        n++;
        stack[n]=x;
    }
}
int pop(){
   return stack[--n]; 
}

int main(void){
    int c,x,a,b;
    
    while((c=getchar())!=EOF){
        if(isdigit(c)){
            ungetc(c,stdin);
            scanf("%d",&x);
            push(x);
        }else{
            switch(c){
                case '+':
                push(pop()+pop());
                break;
                case '-':
                b=pop();
                a=pop();
                push(a-b);
                break;
                case '*':
                push(a:b);
                break;
                case ' ':
                break;
                case '\n':
                printf("%d",pop());
                break;
                default:
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:20:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   20 |         if(isdigit(c)){
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include<stdio.h>
  +++ |+#include <ctype.h>
    2 | #define SIZE 100
main.c:35:23: error: expected ')' before ':' token
   35 |                 push(a:b);
      |                     ~ ^
      |                       )
Language: C

#include<stdio.h>
#define SIZE 100
int stack[SIZE];
int n=0;

void push(int x){
    if(n<SIZE){
        n++;
        stack[n]=x;
    }
}
int pop(){
   return stack[--n]; 
}

int main(void){
    char c
    int x,a,b;
    
    while((c=getchar())!=EOF){
        if(isdigit(c)){
            ungetc(c,stdin);
            scanf("%d",&x);
            push(x);
        }else{
            switch(c){
                case '+':
                push(pop()+pop());
                break;
                case '-':
                b=pop();
                a=pop();
                push(a-b);
                break;
                case '*':
                push(a*b);
                break;
                case ' ':
                break;
                case '\n':
                printf("%d\n",pop());
                break;
                default:
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:17:11: error: expected ';' before 'int'
   17 |     char c
      |           ^
      |           ;
   18 |     int x,a,b;
      |     ~~~    
main.c:20:12: error: 'c' undeclared (first use in this function)
   20 |     while((c=getchar())!=EOF){
      |            ^
main.c:20:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   21 |         if(isdigit(c)){
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include<stdio.h>
  +++ |+#include <ctype.h>
    2 | #define SIZE 100
Language: C

#include<stdio.h>
#define SIZE 100
int stack[SIZE];
int n=0;

void push(int x){
    stack[n]=x;
    n++;
}
int pop(){
    n--
    return stack[n];
}

int main(void){
    char c;
    int x,a,b;
    
    while((c=getchar())!=EOF){
        if(isdigit(c)){
            ungetc(c,stdin);
            scanf("%d",&x);
            push(x);
        }else{
            switch(c){
                case '+':
                push(pop()+pop());
                break;
                case '-':
                b=pop();
                a=pop();
                push(a-b);
                break;
                case '*':
                push(a*b);
                break;
                case ' ':
                break;
                case '\n':
                printf("%d\n",pop());
                break;
                default:
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'pop':
main.c:11:8: error: expected ';' before 'return'
   11 |     n--
      |        ^
      |        ;
   12 |     return stack[n];
      |     ~~~~~~
main.c: In function 'main':
main.c:20:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   20 |         if(isdigit(c)){
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include<stdio.h>
  +++ |+#include <ctype.h>
    2 | #define SIZE 100
Language: C

#include<stdio.h>
#define SIZE 100
int stack[SIZE];
int n=0;

void push(int x){
    stack[n]=x;
    n++;
}
int pop(){
    n--;
    return stack[n];
}

int main(void){
    char c;
    int x,a,b;
    
    while((c=getchar())!=EOF){
        if(isdigit(c)){
            ungetc(c,stdin);
            scanf("%d",&x);
            push(x);
        }else{
            switch(c){
                case '+':
                push(pop()+pop());
                break;
                case '-':
                b=pop();
                a=pop();
                push(a-b);
                break;
                case '*';
                push(pop()*pop());
                break;
                case ' ':
                break;
                case '\n':
                printf("%d\n",pop());
                break;
                default:
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:20:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   20 |         if(isdigit(c)){
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include<stdio.h>
  +++ |+#include <ctype.h>
    2 | #define SIZE 100
main.c:34:25: error: expected ':' or '...' before ';' token
   34 |                 case '*';
      |                         ^
Language: C

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

int main(){
  stack<int> st;
  string s;

  while(cin >> s){
    if(isdigit(s[0])){
      st.push(atoi(s.c_str()));
    }
    else{
      int a = st.top(); st.pop();
      int b = st.top(); st.pop();

      if(s == "+") st.push(b + a);
      if(s == "-") st.push(b - a);
      if(s == "*") st.push(b * a);
    }
  }

  cout << st.top() << endl;
}



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

#include<stdio.h>
#define MAX　100;
int push(x);
int pop():

int main(){
int S[];
int top;

}


int push(int x){

}


int pop(){

}


Compiler output:
main.c:2:9: warning: ISO C99 requires whitespace after the macro name
    2 | #define MAX　100;
      |         ^~~
main.c:3:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    3 | int push(x);
      | ^~~
main.c: In function 'pop':
main.c:4:10: error: expected declaration specifiers before ':' token
    4 | int pop():
      |          ^
main.c:13:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   13 | int push(int x){
      |                ^
main.c:18:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   18 | int pop(){
      |          ^
main.c:21: error: expected '{' at end of input
Language: C

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

int top;
int S[100];

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

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


int main(int argc, char** argv) {
    
    int a,b;
    top = 0;
    char op[99];
    
    while(scanf("%s", op) !=EOF){
        if (op[0] == '+'){
            a = pop();
            b = pop();
            push(a+b);
        }
        else if(op[0] == '-'){
            a = pop();
            b = pop();
            push(a-b);
        }a#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int top, S[100];

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

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

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

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


Compiler output:
main.c: In function 'main':
main.c:34:11: error: stray '#' in program
   34 |         }a#include<stdio.h>
      |           ^
main.c:34:11: error: expected ';' before 'include'
   34 |         }a#include<stdio.h>
      |           ^~~~~~~~
      |           ;
main.c:79:9: error: 'else' without a previous 'if'
   79 |         else if(op[0] == '*'){
      |         ^~~~
Language: C

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
#define MAX 100
#define max 1000000

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

int top;
int S[max];

int main(){
    char c[max];
    int sum = 0;
    int a,b;

    initialize();

    while(cin >> c){
        if(c[0] == '-'){
            a = pop();
            b = pop();
            push(b - a);
        }
        else if(c[0] == '+'){
            push(pop() + pop());
        }
        else if(c[0] == '*'){
            push(pop() * pop());
        }
        else{
            push(atoi(c));
        }   
    }
    
    printf("%d\n",S[1]);

    return 0;
}


void initialize(){
    top = 0;
}

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

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

void push(int x){
    if(isFull())fprintf(stderr,"Overflow");
    top++;
    S[top] = x;
}

int pop(){
    if(isEmpty())fprintf(stderr,"Anderflow");
    top--;
    return S[top+1];
}


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

#include <stdio.h>
 
#define M 100
 
typedef struct{
  
    int array[M];
    int current;
}STACK;
 
void init(STACK*);
int push(STACK*,int);
int pop(STACK*,int*);
 
void main(){
    STACK data;
    int value;
    //init(&data);   
    //push(&data,1); 
    //push(&s,2);
    //push(&s,3);
    
    while(pop(&s,&value)){
        printf("%d ",value);
    }
    printf("¥n");
}
 

void init(STACK* pStack)
{
    int i;
    for(i = 0; i < MAX_LENGTH; i++){
        pStack->array[i] = 0;
    }
  
    pStack->current = 0;
}
int push(STACK* pStack,int value)
{
    if(pStack->current < MAX_LENGTH){
        
        pStack->array[pStack->current] = value;
        pStack->current++;
        return 1;
    }
    
    return 0;
}

int pop(STACK* pStack,int* pValue)
{
    if(pStack->current > 0){
        pStack->current--;
        *pValue = pStack->array[pStack->current];
        return 1;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:23:16: error: 's' undeclared (first use in this function)
   23 |     while(pop(&s,&value)){
      |                ^
main.c:23:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'init':
main.c:33:20: error: 'MAX_LENGTH' undeclared (first use in this function)
   33 |     for(i = 0; i < MAX_LENGTH; i++){
      |                    ^~~~~~~~~~
main.c: In function 'push':
main.c:41:26: error: 'MAX_LENGTH' undeclared (first use in this function)
   41 |     if(pStack->current < MAX_LENGTH){
      |                          ^~~~~~~~~~