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

#include<stdio.h>
int main(){
  int n, i, data[10]={0}, x=0;
  while((1){
    if(n == 0){
      printf("%d\n", data[x]);
      x--;
    }else if(1<=n && n<=10){
      x++;
      data[x] = n;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:12: error: expected ')' before '{' token
    4 |   while((1){
      |        ~   ^
      |            )
main.c:14:1: error: expected expression before '}' token
   14 | }
      | ^
Language: C

#include <stdio.h>
int main(){
	int data[10]={};
	int n, k, i=0;
	for(k=0; K<=10; k++){
		scanf("%d", &n);
		if(n!=0){
			data[i] = n;
			i++;
		} else {
			i--;
			printf("%d\n", data[i]);
			data[i] = 0;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:18: error: 'K' undeclared (first use in this function)
    5 |         for(k=0; K<=10; k++){
      |                  ^
main.c:5:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(){
	int data[10]={};
	int n, k, i=0;
	for(k=0; K<=20; k++){
		scanf("%d", &n);
		if(n!=0){
			data[i] = n;
			i++;
		} else {
			i--;
			printf("%d\n", data[i]);
			data[i] = 0;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:18: error: 'K' undeclared (first use in this function)
    5 |         for(k=0; K<=20; k++){
      |                  ^
main.c:5:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


struct STACK
{
	int num[ 10 ] ;
	int p ;
	
	int		Top( void )	;
	void	Push( int )	;
	void	Pop( void )	;
	void	Init( void ) ;
} stack ;


int main( void )
{
	stack.Init() ;

	int kale ;
	while( scanf( "%d" ,&kale ) != EOF )
	{
		if( kale == 0 )
		{
			printf( "%d\n" ,stack.Top() ) ;

			stack.Pop() ;
		}

		else
		{
			stack.Push( kale ) ;
		}
	}

	return 0 ;
}


void STACK::Init( void )
{
	p = 0 ;
}

void STACK::Push( int kale )
{
	num[ p++ ] = kale ;
}

void STACK::Pop( void )
{
	--p ;
}

int STACK::Top( void )
{
	return num[ p - 1 ] ;
}


Compiler output:
main.c:9:25: error: field 'Top' declared as a function
    9 |         int             Top( void )     ;
      |                         ^~~
main.c:10:17: error: field 'Push' declared as a function
   10 |         void    Push( int )     ;
      |                 ^~~~
main.c:11:17: error: field 'Pop' declared as a function
   11 |         void    Pop( void )     ;
      |                 ^~~
main.c:12:17: error: field 'Init' declared as a function
   12 |         void    Init( void ) ;
      |                 ^~~~
main.c:40:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
   40 | void STACK::Init( void )
      |           ^~
main.c:45:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
   45 | void STACK::Push( int kale )
      |           ^~
main.c:50:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
   50 | void STACK::Pop( void )
      |           ^~
main.c:55:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
   55 | int STACK::Top( void )
      |          ^~
Language: C

#include<stdio.h>
int main(){
int x[100],a,k=0,y[100],i,m=0
while(scanf("%d",&a)!=EOF){
if(a==0)
y[m++]=x[--k];
else if(a!=0){
x[k]=a;
k++;
}
}
for(i=0;i<m;i++)
printf("%d\n",y[i]);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected ',' or ';' before 'while'
    4 | while(scanf("%d",&a)!=EOF){
      | ^~~~~
Language: C

z#include <stdio.h>

int stack[150], cp;

void push(int n)
{
	stack[cp] = n;
	cp++;
}

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

int main(void)
{
	int n;
	stack[0] = -1;
	cp = 1;
	
	while (scanf("%d", &n) != EOF) {
		
		if (n == 0) {
			printf("%d\n", pop());;
		} else {
			push(n);
		}
		
		if (stack[cp-1] == -1) break;
	}
}

Compiler output:
main.c:1:2: error: stray '#' in program
    1 | z#include <stdio.h>
      |  ^
main.c:1:1: error: unknown type name 'z'
    1 | z#include <stdio.h>
      | ^
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | z#include <stdio.h>
      |           ^
main.c: In function 'push':
main.c:7:9: error: 'stack' undeclared (first use in this function)
    7 |         stack[cp] = n;
      |         ^~~~~
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:15: error: 'cp' undeclared (first use in this function)
    7 |         stack[cp] = n;
      |               ^~
main.c: In function 'pop':
main.c:13:9: error: 'cp' undeclared (first use in this function)
   13 |         cp--;
      |         ^~
main.c:14:16: error: 'stack' undeclared (first use in this function)
   14 |         return stack[cp];
      |                ^~~~~
main.c: In function 'main':
main.c:20:9: error: 'stack' undeclared (first use in this function)
   20 |         stack[0] = -1;
      |         ^~~~~
main.c:21:9: error: 'cp' undeclared (first use in this function)
   21 |         cp = 1;
      |         ^~
main.c:23:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   23 |         while (scanf("%d", &n) != EOF) {
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | z#include <stdio.h>
main.c:23:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   23 |         while (scanf("%d", &n) != EOF) {
      |                ^~~~~
main.c:23:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:35: error: 'EOF' undeclared (first use in this function)
   23 |         while (scanf("%d", &n) != EOF) {
      |                                   ^~~
main.c:23:35: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:26:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |                         printf("%d\n", pop());;
      |                         ^~~~~~
main.c:26:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:25: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:4: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |    ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |         ^~~~
main.c: In function 'main':
main.c:1:21: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |                     ^~~~
main.c:1:40: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |                                        ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
main.c:1:45: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |                                             ^~~
      |                                             |
      |                                             int *
main.c:1:45: note: expected 'const char *' but argument is of type 'int *'
main.c:1:39: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
    1 | n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
      |                                       ^
Language: C

n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |   ^
main.c:1:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |     ^
main.c:1:5: error: initializer element is not computable at load time
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |        ^~~~
main.c: In function 'main':
main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                     ^~~~~
main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:36: error: invalid type argument of unary '*' (have 'int')
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                    ^~
main.c:1:46: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                              ^~~~
main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:51: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    1 | n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                                   ^~~
      |                                                   |
      |                                                   int
main.c:1:51: note: expected 'const char *' but argument is of type 'int'
Language: C

a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: 'main' undeclared here (not in a function)
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |   ^~~~
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |        ^~~~
main.c: In function 'main':
main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                     ^~~~~
main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:36: error: invalid type argument of unary '*' (have 'int')
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                    ^~
main.c:1:46: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                              ^~~~
main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:51: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    1 | a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                                   ^~~
      |                                                   |
      |                                                   int
main.c:1:51: note: expected 'const char *' but argument is of type 'int'
Language: C

*a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      | ^
main.c:1:2: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |  ^
main.c:1:4: error: 'main' undeclared here (not in a function)
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |    ^~~~
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |         ^~~~
main.c: In function 'main':
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                      ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                      ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:47: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                               ^~~~
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:52: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                                    ^~~
      |                                                    |
      |                                                    int *
main.c:1:52: note: expected 'const char *' but argument is of type 'int *'
main.c:1:46: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
    1 | *a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                              ^
Language: C

a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:6: error: return type defaults to 'int' [-Wimplicit-int]
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |      ^~~~
main.c: In function 'main':
main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                   ^~~~~
main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:41: error: lvalue required as increment operand
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                         ^~
main.c:1:44: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                            ^~~~
main.c:1:44: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:49: error: lvalue required as decrement operand
    1 | a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                                 ^~
Language: C

main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                 ^~~~~
main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:32: error: invalid type argument of unary '*' (have 'int')
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                ^~
main.c:1:42: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                          ^~~~
main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:47: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    1 | main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |                                               ^~~
      |                                               |
      |                                               int
main.c:1:47: note: expected 'const char *' but argument is of type 'int'
Language: C

main(i,*a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}

Compiler output:
main.c:1:8: error: expected ')' before '*' token
    1 | main(i,*a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
      |        ^
      |        )
Language: C

n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |   ^
main.c:1:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |     ^
main.c:1:5: error: initializer element is not computable at load time
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |        ^~~~
main.c: In function 'main':
main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |                     ^~~~~
main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:38: error: invalid type argument of unary '*' (have 'int')
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |                                      ^~~~
main.c:1:47: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |                                               ^~~~
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:53: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    1 | n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
      |                                                    ~^~
      |                                                     |
      |                                                     int
main.c:1:53: note: expected 'const char *' but argument is of type 'int'
Language: C

#include <stdio.h>

int main(void)
{
	int i;
	int station[10];
	int input_data;
	
	i = 0;
	
	while (scanf("%d", &input_data) != EOF){
		if (input_data != 0){
			station[i] = input_data;
			i++;
		}
		else {
			printf("%d\n", station[i - 1]);
			i--;
			}
		}
	}
	
	return (0);
}

Compiler output:
main.c:23:9: error: expected identifier or '(' before 'return'
   23 |         return (0);
      |         ^~~~~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^
Language: C

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

int main(){
  int n;
  stack<int> r;
  while(scanf("%d",&n)!=EOF)
    if(n){
      r.push(n);
    }else{
      printf("%d\n",r.top());
      r.pop();
    }
  return 0;
}

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

#include<stdio.h>

int main(){
	int car[10];
	int a,c=0;
	while(~scanf("%d",&a)){
		if(a==0)printf{("%d",car[c]);c--;}
		else {
			car[c]=a;
			c++;
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:7:31: error: expected ';' before '{' token
    7 |                 if(a==0)printf{("%d",car[c]);c--;}
      |                               ^
      |                               ;
Language: C

#include<cstdio>
#include<stack>

int main()
{
        int input;
        stack<int> st;
        while(~scanf("%d",&input))
        {
                if(input == 0)
                {
                        printf("%d",st.top());
                        st.pop();
                }else
                {
                        st.push(input);
                }
        }
        return 0;
}

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

//#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
  int car[1000];
  int n,i=0;
  while(cin>>n){
    if(n==0){
      cout<<car[i]<<endl; i--;
    }
    else {
      i++; car[i]=n;
    }
  }
  return 0;
}

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

#include <stdio.h>

int main(void)
{
	int *train;
	int train_no;
	int no;
	int i;
	
	no = 0;
	train = (int *)malloc(1, sizeof(int));
	while (scanf("%d", &train_no) != EOF){
		if (train_no != 0){
			no++;
		}
		else {
			no--;
			printf("%d\n", train[no]);
		}
		train = (int *)realloc(train, no * sizeof(int));
		if (train_no != 0){
			train[no - 1] = train_no;
		}
	}
	free(train);
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:11:24: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   11 |         train = (int *)malloc(1, sizeof(int));
      |                        ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:11:24: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   11 |         train = (int *)malloc(1, sizeof(int));
      |                        ^~~~~~
main.c:11:24: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:11:24: error: too many arguments to function 'malloc'
main.c:20:32: error: implicit declaration of function 'realloc' [-Wimplicit-function-declaration]
   20 |                 train = (int *)realloc(train, no * sizeof(int));
      |                                ^~~~~~~
main.c:20:32: note: include '<stdlib.h>' or provide a declaration of 'realloc'
main.c:20:32: warning: incompatible implicit declaration of built-in function 'realloc' [-Wbuiltin-declaration-mismatch]
main.c:20:32: note: include '<stdlib.h>' or provide a declaration of 'realloc'
main.c:25:9: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   25 |         free(train);
      |         ^~~~
main.c:25:9: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:25:9: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:25:9: note: include '<stdlib.h>' or provide a declaration of 'free'
Language: C

#include <stdio.h>

int main(void)
{
	int a[10];
	int p;
	int b;
	
	p = 0;
	while (scanf("%d", &b){
		if (b == 0){
			printf("%d\n", a[p]);
			p--;
		}
		else {
			a[p] = b;
			p++;
		}
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:10:31: error: expected ')' before '{' token
   10 |         while (scanf("%d", &b){
      |               ~               ^
      |                               )
main.c:22:1: error: expected expression before '}' token
   22 | }
      | ^
Language: C

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

int main(void)
{
	int arr[1000],arr2[1000],n,i,j,c,k;
	i = 0;
	j = 0;
	while(scanf("%d",&n) != EO{
		scanf("%d",&n);
		if(n == 0){
			arr2[i] = arr[j-1];
			j = j - 1;
			i = i + 1;
		}else{
			arr[j] = n;
			j = j + 1;
		}
		if(j == 0){
			break;
		}
	}
	for(k = 0; k < i; k++){
		printf("%d\n",arr2[k]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:33: error: 'EO' undeclared (first use in this function); did you mean 'EOF'?
    9 |         while(scanf("%d",&n) != EO{
      |                                 ^~
      |                                 EOF
main.c:9:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:35: error: expected ')' before '{' token
    9 |         while(scanf("%d",&n) != EO{
      |              ~                    ^
      |                                   )
main.c:27:1: error: expected expression before '}' token
   27 | }
      | ^
Language: C

s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:4: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |    ^
main.c:1:6: error: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |      ^
main.c:1:6: error: initializer element is not constant
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |        ^~~~
main.c: In function 'main':
main.c:1:20: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |                    ^~~~
main.c:1:38: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |                                      ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
main.c:1:43: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |                                           ^~~
      |                                           |
      |                                           int *
main.c:1:43: note: expected 'const char *' but argument is of type 'int *'
main.c:1:37: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
    1 | s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
      |                                     ^
Language: C

s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:5: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |     ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |       ^~~~
main.c: In function 'main':
main.c:1:19: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |                   ^~~~
main.c:1:37: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |                                     ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
main.c:1:43: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |                                          ~^~~~
      |                                           |
      |                                           int *
main.c:1:43: note: expected 'const char *' but argument is of type 'int *'
main.c:1:48: error: expected ')' before ';' token
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |                 ~                              ^
      |                                                )
main.c:1:49: error: expected expression before '}' token
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      |                                                 ^
main.c: At top level:
main.c:1:1: warning: array 's' assumed to have one element
    1 | s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
      | ^
Language: C

#include <stack>
#include <iostream>

int main(){
        using namespace std;

        stack<int> st;
        int n;
        while ( cin >> n ){
                if(n != 0){
                        st.push(n);
                }else if(n == 0){
                        cout << st.top() << endl;
                        st.pop();
                }
        }
        return 0;
}

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

#include<stdio.h>

int main(void){
	int x,j,k,in[20],out[20];

	j = 0;
	while(scanf("%d",&x) != EOF){
		if(x != 0){
			in[j] = x;
			j ++;
		}else{
			printf("%d\n",out[j]);
			j --;
		}

	return 0;
}

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

include<stdio.h>
main(){

  int tmp,i,j,tr[10000],ans[10000]={};

  for(i=0;;i++){
    if(scanf("%d",&tr[i]) == EOF){
      break;
    }
  }

  tmp=i;

  for(i=0;i<tmp;i++){
    if(tr[i]==0){
      for(j=i-1;j>=0;j--){
	if(tr[j]!=0){
	  ans[i]=tr[j];
	  tr[j]=0;
	  break;
	}
      }
    }
  }

  for(i=0;i<tmp;i++){
    if(ans[i]!=0){
      printf("%d\n",ans[i]);
    }
  }
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
using namespace std;

int main() {
	int in;
	vector <int> a;
	while (cin >> in;) {
		if (in == 0) {
			cout << a.back();
			a.pop_back();
			/*if (a.size() == 0)
				break;
			else*/
				cout << endl;
		}
		else
			a.push_back(in);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' before ';' token
    9 |         while (cin >> in;) {
      |               ~         ^
      |                         )
a.cc:9:26: error: expected primary-expression before ')' token
    9 |         while (cin >> in;) {
      |                          ^
Language: C++

#include <cstdio>
#include <stack>
using namespace std;
int main(){
	int n;
	stack<int> car;
	while(scanf("%d",&n)!) {
		if(n!=0) car.push(n);
		else{
			printf("%d\n",car.top());
			car.pop();
		}
	}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected ')' before '!' token
    7 |         while(scanf("%d",&n)!) {
      |              ~              ^
      |                             )
a.cc:7:30: error: expected primary-expression before ')' token
    7 |         while(scanf("%d",&n)!) {
      |                              ^
Language: C++

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

int main() {
	int n, count = 0, a[10], i;
	stack<int> s;
	while (cin >> n,n>=0,!cin.eof()) {
		if (n > 0) s.push(n);
		else if (n == 0) { a[count] = s.top(); s.pop(); count++}
	}
	for (i = 0; i < count; i++) {
		cout << a[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:72: error: expected ';' before '}' token
   10 |                 else if (n == 0) { a[count] = s.top(); s.pop(); count++}
      |                                                                        ^
      |                                                                        ;
Language: C++

#include <stack>
using namespace std;
int main()
{
	stack<int> s;
	int k;
	while (cin >> k){
		if (0 == k){
			k = s.top();
			s.pop();
			cout << k << "\n";
		}
		else s.push(k);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'cin' was not declared in this scope
    7 |         while (cin >> k){
      |                ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stack>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:11:25: error: 'cout' was not declared in this scope
   11 |                         cout << k << "\n";
      |                         ^~~~
a.cc:11:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <stack>

int main(){

	std::stack<int> train;

	int buf;

	while(std::cin >> buf){

		if(buf == 0){

			std::cout << train.top() << endl;
			train.pop();

		}else{

			train.push(buf);

		}
	
	}

	return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:14:53: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |                         std::cout << train.top() << endl;
      |                                                     ^~~~
      |                                                     std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

int main(){
	std::stack<int> railroad;
	
	int incar;
	while(std::cin >> incar){
		if(incar != 0){
			railroad.push(incar);
		}else{
			std::cout << railroad.top() << std::endl;
			railroad.pop();
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'stack' is not a member of 'std'
    4 |         std::stack<int> railroad;
      |              ^~~~~
a.cc:2:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    1 | #include <iostream>
  +++ |+#include <stack>
    2 | 
a.cc:4:20: error: expected primary-expression before 'int'
    4 |         std::stack<int> railroad;
      |                    ^~~
a.cc:9:25: error: 'railroad' was not declared in this scope
    9 |                         railroad.push(incar);
      |                         ^~~~~~~~
a.cc:11:38: error: 'railroad' was not declared in this scope
   11 |                         std::cout << railroad.top() << std::endl;
      |                                      ^~~~~~~~
Language: C++

#include <iostream>
#include <deque>

int main(){
	std::deque<int> que;
	int tmp;
	while(std::cin >> tmp){
		if(tmp == 0) std::cout << que.pop() << std::endl;
		else que.push(tmp);
	}
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:47: error: 'class std::deque<int>' has no member named 'pop'
    8 |                 if(tmp == 0) std::cout << que.pop() << std::endl;
      |                                               ^~~
a.cc:9:26: error: 'class std::deque<int>' has no member named 'push'
    9 |                 else que.push(tmp);
      |                          ^~~~
Language: C++

q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())})

Compiler output:
a.cc:1:1: error: 'q' does not name a type
    1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())})
      | ^
a.cc:1:13: error: expected constructor, destructor, or type conversion before '(' token
    1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())})
      |             ^
a.cc:1:122: error: expected unqualified-id before ')' token
    1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())})
      |                                                                                                                          ^
Language: C++

#include<stdio.h>
int main(){
int a[100];
int j;
for(int i=0;;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(){
if(j1!=0){
printf("%d",a[j1]);
break;
}
j--;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected primary-expression before ')' token
    9 | while(){
      |       ^
a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'?
   10 | if(j1!=0){
      |    ^~
      |    j
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
int a[100];
int j;
for(int i=0;;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(){
if(j1!=0){
printf("%d",a[j1]);
break;
}
j--;
}
a[j-1]=0;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected primary-expression before ')' token
    9 | while(){
      |       ^
a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'?
   10 | if(j1!=0){
      |    ^~
      |    j
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
int a[100];
int j;
for(int i=0;;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(){
if(j1!=0){
printf("%d",a[j1]);
break;
}
j--;
}
a[j-1]=0;
if(j-1==0){
break;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected primary-expression before ')' token
    9 | while(){
      |       ^
a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'?
   10 | if(j1!=0){
      |    ^~
      |    j
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
int a[100];
int j;
for(int i=0;;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(){
if(j-1!=0){
printf("%d",a[j-1]);
break;
}
j--;
}
a[j-1]=0;
if(j-1==0){
break;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected primary-expression before ')' token
    9 | while(){
      |       ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
int a[100];
int j,a=0;
for(int i=0;i<100;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(a=0){
if(j-1!=0){
printf("%d",a[j-1]);
a=1;
}
j--;
}
a=0;
a[j]=0;
if(j-1==0){
i=101;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: conflicting declaration 'int a'
    4 | int j,a=0;
      |       ^
a.cc:3:5: note: previous declaration as 'int a [100]'
    3 | int a[100];
      |     ^
a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [100]'
    9 | while(a=0){
      |       ~^~
a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [100]'
   12 | a=1;
      | ~^~
a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [100]'
   16 | a=0;
      | ~^~
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
int a[500];
int j,a=0;
for(int i=0;i<500;i++){
scanf("%d",&a[i]);
if(a[i]==0){
j=i;
while(a=0){
if(j-1!=0){
printf("%d\n",a[j-1]);
a=1;
}
j--;
}
a=0;
a[j]=0;
if(j==0){
i=501;
}
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: conflicting declaration 'int a'
    4 | int j,a=0;
      |       ^
a.cc:3:5: note: previous declaration as 'int a [500]'
    3 | int a[500];
      |     ^
a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [500]'
    9 | while(a=0){
      |       ~^~
a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [500]'
   12 | a=1;
      | ~^~
a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [500]'
   16 | a=0;
      | ~^~
Language: C++


import java.util.Scanner;
import java.util.Stack;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		Stack<Integer> stack = new Stack<Integer>();
		while (scn.hasNext()) {
			int n = scn.nextInt();
			if (n == 0) {
				System.out.println(stack.pop());
			} else {
				stack.push(n);
			}
		}
	}
}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Stack;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#include <stdio.h>

int train[10];
int sp = 0;

int empty() {
  return sp <= 0;
}

int size() {
  return sp;
}

int top() {
  return train[sp-1];
}

void pop() {
  sp--;
}

void push(int v) {
  train[sp] = v;
  sp++;
}

int main(){
  int num;
  while(1){
    scanf("%d", &num);
    if(num == 0){
      printf("%d\n", top());
      pop();
    }else{
      push(num);
    }
    if(size() = 0) break;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: lvalue required as left operand of assignment
   37 |     if(size() = 0) break;
      |        ~~~~^~
Language: C++

#include <stdio.h>

int train[10];
int sp = 0;

int empty() {
  return sp <= 0;
}

int size() {
  return sp;
}

int top() {
  return train[sp-1];
}

void pop() {
  sp--;
}

void push(int v) {
  train[sp] = v;
  sp++;
}

int main(){
  int out[10];
  int num, i = 0;
  while(1){
    scanf("%d", &num);
    if(num == 0){
      out[i] = top();
      i++;
      pop();
    }else if(1 <= num && num <= 10){
      push(num);
    }
    if(size() == 0) break;
  }
  for(i = 0, i < 10, i++){
    printf("%d\n", out[i]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: expected ';' before ')' token
   41 |   for(i = 0, i < 10, i++){
      |                         ^
      |                         ;
a.cc:44:3: error: expected primary-expression before 'return'
   44 |   return 0;
      |   ^~~~~~
a.cc:43:4: error: expected ';' before 'return'
   43 |   }
      |    ^
      |    ;
   44 |   return 0;
      |   ~~~~~~
a.cc:44:3: error: expected primary-expression before 'return'
   44 |   return 0;
      |   ^~~~~~
a.cc:43:4: error: expected ')' before 'return'
   43 |   }
      |    ^
      |    )
   44 |   return 0;
      |   ~~~~~~
a.cc:41:6: note: to match this '('
   41 |   for(i = 0, i < 10, i++){
      |      ^
Language: C++

#include <stdio.h>

int main(void)
{
	int a[10];
	int b[10];
	int c;
	int i=0;
	int t=0;	
	do{
		scanf_s("%d",&c);
		if (c >= 1 && c <= 10){	
			a[t] = c;			
			t++;				
		}
		else if (c == 0){		
			t--;		
			b[i] = a[t];	
			i++;
			
		}

	} while (t > 0);	

	printf("\n");
	for (c = 0; c < i; c++){	
		printf("%d\n",b[c]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |                 scanf_s("%d",&c);
      |                 ^~~~~~~
      |                 scanf
Language: C++

    #include <iostream>
    using namespace std;
     
    int a[11], b, t;
     
    int main() {
      cin>>a[0];
      t=1;
      c=0;
     
      while(cin>>b) {
        if(b>0) {
          a[t]=b;
          t++;
        }else {
          cout<<a[t-1]<<endl;
          t--;
        }
      }
      
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'c' was not declared in this scope
    9 |       c=0;
      |       ^
Language: C++

#include<iostream>
using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}}

Compiler output:
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}}
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:2:57: error: 'n' was not declared in this scope
    2 | using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}}
      |                                                         ^
Language: C++

import java.util.ArrayDeque;
import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	ArrayDeque<Integer> stack = new ArrayDeque<Integer>();
	int n;
	while (scan.hasNext()) {
	    n = Integer.parseInt(scan.nextLine());
	    if (n == 0) {
		System.out.println(stack.pop());
	    } else {
		stack.push(n);
	    }
	}
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.ArrayDeque;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~