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

def side(p1, p2, p3):
    return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0

while True:
    try:
        x = map(float, raw_input().split())
        p1 = x[0:2]
        p2 = x[2:4]
        p3 = x[4:6]
        p0 = x[6:]
        if (side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0)):
            print "YES"
        else:
            print "NO"
    except:
        break

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def side(p1, p2, p3):
      | ^~~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int main(){

	double x[3],y[3],px,py,x1,x2,y1,y2,f;
	int f3,i;
		
	while(scanf_s("%f%f%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&px,&py)>0){
		f3=0;
		for(i=0;i<3;i++){
			x1=x[i];
			y1=y[i];
			x2=x[(i+1)%3];
			y2=y[(i+1)%3];
			f=x1*(py-y2)+px*(y2-y1)+x2*(y1-py);
			if(f>0){
				f3++;
			}else if(f<0){
				f3--;
			}
			cout << f << endl;
		}
		if(abs(f3)==3)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         while(scanf_s("%f%f%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&px,&py)>0){
      |               ^~~~~~~
      |               scanf
Language: Java

import java.util.Scanner;
import java.util.Deque;
import java.util.Linkedlist;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
Deque<Integer> d=new Linkedlist<Integer>();
while(sc.hasNextInt()){
int n=sc.nextInt();
if(n==0){
System.out.println(d.pollFirst());
}
else{
d.offerFirst(n);
}
}
}
}

Compiler output:
Main.java:3: error: cannot find symbol
import java.util.Linkedlist;
                ^
  symbol:   class Linkedlist
  location: package java.util
Main.java:8: error: cannot find symbol
Deque<Integer> d=new Linkedlist<Integer>();
                     ^
  symbol:   class Linkedlist
  location: class Main
2 errors
Language: Java

import java.util.*;
public class aoj0013 {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		Stack<Integer> st = new Stack<Integer>();
		while(stdin.hasNext()){
			int i = stdin.nextInt();
			if( i == 0 ) System.out.println( st.pop() );
			else st.push(i);
		}
	}
}

Compiler output:
Main.java:2: error: class aoj0013 is public, should be declared in a file named aoj0013.java
public class aoj0013 {
       ^
1 error
Language: Java

public class aoj0013 {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args) {
		Stack<Integer> st = new Stack<Integer>();
		while(stdin.hasNext()){
			int i = stdin.nextInt();
			if( i == 0 ) System.out.println( st.pop() );
			else st.push(i);
		}
	}
}

Compiler output:
Main.java:1: error: class aoj0013 is public, should be declared in a file named aoj0013.java
public class aoj0013 {
       ^
Main.java:2: error: cannot find symbol
	static final Scanner stdin = new Scanner(System.in);
	             ^
  symbol:   class Scanner
  location: class aoj0013
Main.java:2: error: cannot find symbol
	static final Scanner stdin = new Scanner(System.in);
	                                 ^
  symbol:   class Scanner
  location: class aoj0013
Main.java:4: error: cannot find symbol
		Stack<Integer> st = new Stack<Integer>();
		^
  symbol:   class Stack
  location: class aoj0013
Main.java:4: error: cannot find symbol
		Stack<Integer> st = new Stack<Integer>();
		                        ^
  symbol:   class Stack
  location: class aoj0013
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
 
public class prog {
    public static void main(String[] args) {
        printAnswer();
    }
 
    private static void printAnswer() {
        Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
 
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            List<Integer> trainList = new ArrayList<>();
            String dataset = br.readLine();
 
            while (dataset != null) {
                int integer = Integer.parseInt(dataset);
                if(integer != 0){
                    trainList.add(integer);
                }else{
                    System.out.println(trainList.get(trainList.size()-1));
                    trainList.remove(trainList.size()-1);
                }
                dataset = br.readLine();
            }
        } catch (IOException e) {
            logger.info("Error:  Reading input data is failed.");
        }
    }
}

Compiler output:
Main.java:8: error: class prog is public, should be declared in a file named prog.java
public class prog {
       ^
1 error
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Stack<Integer> stack = new Stack<Integer>();
        while(sc.hasNextInt()){
            int a=sc.nextInt();
            if(a==0){
                System.out.println(stack.pop());
            }else{
                stack.push();
            }
        }
    }
}

Compiler output:
Main.java:12: error: method push in class Stack<E> cannot be applied to given types;
                stack.push();
                     ^
  required: Integer
  found:    no arguments
  reason: actual and formal argument lists differ in length
  where E is a type-variable:
    E extends Object declared in class Stack
1 error
Language: Java

import java.io.*;
public class Main {
	public static void main(String[]args)throws IOException{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		int[] list=new list[10];
		int top=0;
		while(str!=null){
			int num=Integer.parseInt(str);
			if(num==0){
				System.out.println(list[top-1]);
				top--;
			}else{
				list[top]=num;
				top++;
			}
		}
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		int[] list=new list[10];
		               ^
  symbol:   class list
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
	private static final scan = Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int in = scan.nextInt();
			int size = list.size();
			if(in == 0){
				list.remove(size - 1);
			}
			list.add(in);
		}

		for(int i = size - 1; i >= 0; i++){
			System.out.printf("%d\n", list.get(i));
		}
	}
}

Compiler output:
Main.java:4: error: <identifier> expected
	private static final scan = Scanner(System.in);
	                         ^
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int in = scan.nextInt();
			int size = list.size();
			if(in == 0){
				list.remove(size - 1);
			}
			list.add(in);
		}

		for(int i = size - 1; i >= 0; i++){
			System.out.printf("%d\n", list.get(i));
		}
	}
}

Compiler output:
Main.java:17: error: cannot find symbol
		for(int i = size - 1; i >= 0; i++){
		            ^
  symbol:   variable size
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int size;
		while(scan.hasNext()){
			int in = scan.nextInt();
			size = list.size();
			if(in == 0){
				list.remove(size - 1);
			}
			list.add(in);
		}
		for(int i = size - 1; i >= 0; i++){
			System.out.printf("%d\n", list.get(i));
		}
	}
}

Compiler output:
Main.java:17: error: variable size might not have been initialized
		for(int i = size - 1; i >= 0; i++){
		            ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class main {
	public static void main(String[] args){

		//?????°??£?¨?
		ArrayList<Integer> Shin = new ArrayList<Integer>();
		int i = 0;
		Integer hyouzi;

		Scanner sc = new Scanner(System.in);

		while (sc.hasNext()){
			Shin.add(sc.nextInt());
			if(Shin.get(i) == 0){
				hyouzi = Shin.get(i-1);
				System.out.println(hyouzi);
				Shin.remove(i);
				Shin.remove(i-1);		//??°????????\??£???????????±????¶????
				i = i - 1;
			}else{
				i = i + 1;
			}
		}
	}
}

Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		String strLine ="";
		BufferedReader stdReader =
				new BufferedReader(new InputStreamReader(System.in));

		int MAX_DETASET  = 100;
		int cnt = 0;

		boolean nullflug = true;
		ArrayList<Integer> pushList = new ArrayList<Integer>();
		ArrayList<Integer> popList = new ArrayList<Integer>();

		//1. int?????????????????\???????????????????????????

8		while((strLine = stdReader.readLine()) != null) {
			int temp = 0;
			//if(!strLine.equals("")){
				temp = Integer.parseInt(strLine);
		//	}
			if(temp == 0 ){
				popList.add(pushList.get(cnt-1));
				pushList.remove(cnt-1);
				cnt--;
			}else{
				pushList.add(temp);
				cnt++;
			}

		}

		//2. ??????

		for(int i = 0; i < popList.size(); i++){

			System.out.println(popList.get(i));

		}


	}


}

Compiler output:
Main.java:23: error: not a statement
8		while((strLine = stdReader.readLine()) != null) {
^
Main.java:23: error: ';' expected
8		while((strLine = stdReader.readLine()) != null) {
 ^
2 errors
Language: Java

import java.io.*;
public class Main {

	public static void main(String[] args)throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		stack s = new stack();
		while(true){
			str = br.readLine();
			int n = Integer.parseInt(str);
			if(n != 0)
				s.push(n);
			else{
				int pop = s.pop();
				if(s.isEmpty()){
					System.out.println(pop);					
					break;
				}
				System.out.println(pop);
			}
			
		}

	}

}
class stack{
	int[] st = new int[1000];
	int count = 0; // ツ債。ツつ「ツつュツづつ禿シツづづつ「ツづゥツつゥ
	
	int pop(){
		return st[--count];
	}
	void push(int n){
		st[count++] = n;
	}
	boolean isEmpty(){
		if(count == 0)
			return true;
		else
			return false;
	}
	

Compiler output:
Main.java:43: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.*;

public class Main{

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

Compiler output:
Main.java:1: error: package java does not exist
import java.*;
^
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		Stack<Integer> s = new Stack<Integer>();
		^
  symbol:   class Stack
  location: class Main
Main.java:7: error: cannot find symbol
		Stack<Integer> s = new Stack<Integer>();
		                       ^
  symbol:   class Stack
  location: class Main
5 errors
Language: Java

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

public class AOJ0013 {

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

Compiler output:
Main.java:4: error: class AOJ0013 is public, should be declared in a file named AOJ0013.java
public class AOJ0013 {
       ^
1 error
Language: Java

import java.util.*;public class Main {public static void main(String[] args) {Scanner s = new Scanner(System.in);Stack data = new Stack();while(s.hasNext()){int in = s.nextInt();if(in != 0)data.push(in);elseSystem.out.println(data.pop());}}}

Compiler output:
Main.java:1: error: package elseSystem does not exist
import java.util.*;public class Main {public static void main(String[] args) {Scanner s = new Scanner(System.in);Stack data = new Stack();while(s.hasNext()){int in = s.nextInt();if(in != 0)data.push(in);elseSystem.out.println(data.pop());}}}
                                                                                                                                                                                                                     ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

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

public class aoj0013 {
    
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Stack data = new Stack();
		while(s.hasNext()){
			int in = s.nextInt();
			if(in != 0)
				data.push(in);
			else
				System.out.println(data.pop());
		}
    }
}

Compiler output:
Main.java:4: error: class aoj0013 is public, should be declared in a file named aoj0013.java
public class aoj0013 {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

mport java.util.Scanner;

public class Main
{
	public static void main(String arg[])
	{
		Scanner scan = new Scanner(System.in);
		int cb[] = new int[10+1];
		int index = 0;
		while(scan.hasNext())
		{
			
			int ca = scan.nextInt();
			if (ca == 0)
			{
				System.out.println(cb[index-1]);
				index--;
				continue;
			}
			cb[index] = ca;
			index++;
		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main2 {
    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
        List<Integer> lst = new LinkedList<Integer>();
        while(input.hasNext()){
        	int a = input.nextInt();
        	if(a == 0){
        		System.out.println(lst.get(lst.size()-1));
        		lst.remove(lst.size()-1);
        	}else{
        		lst.add(a);
        	}
        }
    }    
}

Compiler output:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

#include <iostream>
using namespace std;

int main(){
    int cnt = 0;
    int sta;
    int train[10]={0};
    while(cin >> sta){
        if(sta == 0){
            cnt--;
            cout << train[cnt] << endl;
        }
        else {
            train[cnt] = sta;
            cnt++;
        }
    }
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:7: error: not a statement
    int train[10]={0};
                   ^
Main.java:11: error: not a statement
            cout << train[cnt] << endl;
                               ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: ']' expected
    int train[10]={0};
              ^
Main.java:7: error: ';' expected
    int train[10]={0};
                    ^
7 errors
Language: Java

import java.io.*;
port java.util.*;

public class Main{
	public static void main(String[] args){
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		LinkedList<Integer> stack=new LinkedList<Integer>();
		ArrayList<Integer> list=new ArrayList<Integer>();
		String s;
		int n,t;
		try{
			while(true){
			while((s=reader.readLine()) !=null){
				n=Integer.parseInt(s);
				if(n ==0){
					t=stack.removeFirst();
					list.add(t);
				}else{
					stack.addFirst(n);
				}
				if(stack.size()==0){
					break;
				}
			}
			int x=list.size();
			int[] z=new int[x];
			for(int i=0;i<x;i++){
					z[i]=list.get(i);
			}
			for(int j=0;j<x;j++){
				System.out.println(z[j]);
			}
			}
		}catch(IOException e){
			e.printStackTrace();
		}catch(NoSuchElementException e){
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
port java.util.*;
^
1 error
Language: C

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

//#define DEBUG 1
#define TRAIN_NUMBER 10
 
int push(int array[TRAIN_NUMBER], int num, int count);
int pop(int array[TRAIN_NUMBER], int ans[TRAIN_NUMBER], int count, int *ans_c);

main()
{
	int train[TRAIN_NUMBER];
	int ans[TRAIN_NUMBER];
	int count = 0;
	int ans_c = 0;
	int input;
	int i;
	
	for(i = 0; i < TRAIN_NUMBER; i++)
	{
		train[i] = '\0';
		ans[i] = '\0';
	}	
	while (scanf("%d", &input) != EOF)
	{	
		
		if(input != 0)
		{
			count = push(train, input, count);
		}
		else
		{
			count = pop(train, ans, count, &ans_c);
		}
	}
	
	for(i = 0; i < sizeof ans / sizeof ans[0]; i++)
	{
		printf("%d\n",ans[i]);
	}

	return 0;
}

int push(int array[TRAIN_NUMBER], int num, int count)
{
	
	array[count] = num;
#ifdef DEBUG
	printf("array: %d\n", count);
#endif
	return ++count;
	
}

int pop(int array[TRAIN_NUMBER], int ans[TRAIN_NUMBER], int count, int *ans_c)
{
	count--;
	ans[*ans_c] = array[count];
	array[count] = '\0';
	*ans_c--;
	return count;

}

Compiler output:
main.c:10:1: error: return type defaults to 'int' [-Wimplicit-int]
   10 | main()
      | ^~~~
main.c: In function 'main':
main.c:24:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   24 |         while (scanf("%d", &input) != EOF)
      |                ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <stdlib.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:24:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   24 |         while (scanf("%d", &input) != EOF)
      |                ^~~~~
main.c:24:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:39: error: 'EOF' undeclared (first use in this function)
   24 |         while (scanf("%d", &input) != EOF)
      |                                       ^~~
main.c:24:39: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:24:39: note: each undeclared identifier is reported only once for each function it appears in
main.c:39:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   39 |                 printf("%d\n",ans[i]);
      |                 ^~~~~~
main.c:39:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:39:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:39:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
 
int main(){
    int train[10], ;
    int num = 0, i, n;

    while(scanf("%d", &n) != EOF){
        if(n == 0){
            num--;
            printf("%d\n", train[num]);
        } else {
            train[num] = n;
            num++;
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: expected identifier or '(' before ';' token
    4 |     int train[10], ;
      |                    ^
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:
main.c: In function 'main':
main.c:4:7: error: conflicting types for 'a'; have 'int'
    4 | int j,a=0;
      |       ^
main.c:3:5: note: previous declaration of 'a' with type 'int[500]'
    3 | int a[500];
      |     ^
Language: C

#include <stdio.h>
int	main()	{
	int n,cnt =0,copy,i =0;
	int data[100];
	while(1){
		scanf("%d",&n);
		if(n != EOF){
			if(n != 0){
				data[i] = n;
				i++;
			}else(n == 0){
				i--;
				printf("%d\n",data[i]);
			}
		}else{
			break;
		}
	}
	return	0;
}

Compiler output:
main.c: In function 'main':
main.c:11:38: error: expected ';' before '{' token
   11 |                         }else(n == 0){
      |                                      ^
      |                                      ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:4:23: error: invalid initializer
    4 |         int data[10] =0;
      |                       ^
Language: C

#include<stdio.h>
const int SIZE = 10;
int main(void){
    int i = 0,k = 0,cnt = 0,data[SIZE],box[SIZE]={0};
    while(1){
        scanf("%d",&data[i]);
        if(data[i] == 0){
            i --;
            box[k] = data[i];
            k ++;
            cnt ++;
           // printf("%d\n",data[i]);
            if(i == 0)break;
        }
        else i ++;
    }
    for(k = 0; k < cnt; k ++ ){
        printf("%d\n",box[k]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:50: error: variable-sized object may not be initialized except with an empty initializer
    4 |     int i = 0,k = 0,cnt = 0,data[SIZE],box[SIZE]={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:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Stack;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Stack;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include <stdio.h>

int main() {
	int i = 0, k = 0, n, car[10] = {0}, out[10] = {0};
	do{
		scanf("%d", &n);
		if(n == 0) {
			i--;
			out[k] = car[i];
			k++
		} else {
			car[i] = n;
			i++;
		}
	} while( i != 0 );
	for(i = k; i = 0; i--) printf("%d\n", out[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:28: error: expected ';' before '}' token
   10 |                         k++
      |                            ^
      |                            ;
   11 |                 } else {
      |                 ~
Language: C


int main(){

	int a[10],b[10],c;
	int i = 0 ,tra = 0;
	
	do {
	
		scanf("%d" ,&c);
		it (c >= 1 && c <= 10){
				a[tra] = c;
				tra++;
		}
		else if( c == 0){
			tra--;
			b[i] = a[tra];
			i++;
		}
		
	}while (tra > 0); 
	
	printf("\n");
	
	for (c = 0; c < i ; c++){
			printf("%d\n",b[c]):
	}
	
	return 0;
	
}
	

Compiler output:
main.c: In function 'main':
main.c:9:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |                 scanf("%d" ,&c);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:9:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |                 scanf("%d" ,&c);
      |                 ^~~~~
main.c:9:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:17: error: implicit declaration of function 'it' [-Wimplicit-function-declaration]
   10 |                 it (c >= 1 && c <= 10){
      |                 ^~
main.c:10:39: error: expected ';' before '{' token
   10 |                 it (c >= 1 && c <= 10){
      |                                       ^
      |                                       ;
main.c:22:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   22 |         printf("\n");
      |         ^~~~~~
main.c:22:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:44: error: expected ';' before ':' token
   25 |                         printf("%d\n",b[c]):
      |                                            ^
      |                                            ;
Language: C

#include <stdio.h>

int main(void)
{
	int a[10], b[10] , c;
	int i=0,tra=0;	

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

	} while (tra > 0);	

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

Compiler output:
main.c: In function 'main':
main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |                 scanf_s("%d",&c);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include <stdio.h>

int main(void)
{
	int a[10], b[10] , c;
	int i=0;
        int t=0;	

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

	} while (t > 0);	

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

Compiler output:
main.c: In function 'main':
main.c:24:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |         print("\n");
      |         ^~~~~
      |         printf
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:
main.c: In function 'main':
main.c:6:10: error: expected ';' before 'int'
    6 | int b[10]
      |          ^
      |          ;
    7 | int c;
      | ~~~       
main.c:11:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   11 |                 scanf_s("%d",&c);
      |                 ^~~~~~~
      |                 scanf
main.c:18:25: error: 'b' undeclared (first use in this function)
   18 |                         b[i] = a[t];
      |                         ^
main.c:18:25: note: each undeclared identifier is reported only once for each function it appears in
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:
main.c: In function 'main':
main.c:11:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   11 |                 scanf_s("%d",&c);
      |                 ^~~~~~~
      |                 scanf
Language: C

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

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

#include<stdio.h>

int main(void){
	int in[10],out[10];
	int i=0,j=0,tmp;
	
	while(scanf("%d",&tmp)!=EOF){
		if(tmp!=0){
			in[i]=tmp
			i++;
		}
		else{
			out[j]=in[i];
			i--;
			j++;
		}
	}
	for(i=0;i<j;i++){
		printf("%d\n",out[i]);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:34: error: expected ';' before 'i'
    9 |                         in[i]=tmp
      |                                  ^
      |                                  ;
   10 |                         i++;
      |                         ~
Language: C

#include<stdio.h>

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

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

#include <stdio.h>

int main(){
	int num,stack[10]={0},p=0;
	while(scanf("%d",&num)!=EOF){
		if(n==0) printf("%d\n"stack[p--]);
		else stack[p++]=n;
	}
	rerturn 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:20: error: 'n' undeclared (first use in this function)
    6 |                 if(n==0) printf("%d\n"stack[p--]);
      |                    ^
main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:39: error: expected ')' before 'stack'
    6 |                 if(n==0) printf("%d\n"stack[p--]);
      |                                ~      ^~~~~
      |                                       )
main.c:9:9: error: 'rerturn' undeclared (first use in this function)
    9 |         rerturn 0;
      |         ^~~~~~~
main.c:9:16: error: expected ';' before numeric constant
    9 |         rerturn 0;
      |                ^~
      |                ;
Language: C

#include <Stdio.h>
int a[22];
int sp=0;
int push(int x){
  sp++;
  a[sp]=x;
}
int pop(){
  int x;
  x=a[sp];
  sp--;
  return x;
}
int main(){
  int x;
  while(scanf("%d",&x)!=EOF){
    if(x==0)printf("%d\n",pop());
    else push(x);
  }
  return 0;
}

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

#include<stdio.h>
#include <math.h>   
int main(){
 
  int n,sya[1000],cnt;
  
  cnt =0;
  while(scanf("%d",&n)==0){

    if(n==0){
       printf("%d\n", sya[cnt-1]);
       cnt =cnt-1
    }else{

//    scanf("%d",&n);
    sya[cnt]=n;
    cnt=cnt+1;
    }


}   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:18: error: expected ';' before '}' token
   12 |        cnt =cnt-1
      |                  ^
      |                  ;
   13 |     }else{
      |     ~
Language: C

#include<stdio.h>
int main(void){
   int a[200], k, key = 1, i, l;
   a[0] = 0;
   for( i = 0; i < 201; i++ ) a[i] = 0;
   whlie ( scanf("%d", &k) != EOF) {
      if (k == 0) {
         key--;
         for (l = 0; l < 201; l++) if( a[l] == key) printf("%d\n", l);
      } else {
         a[k] = key;
         key++;
      } 
   }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:4: error: implicit declaration of function 'whlie' [-Wimplicit-function-declaration]
    6 |    whlie ( scanf("%d", &k) != EOF) {
      |    ^~~~~
main.c:6:35: error: expected ';' before '{' token
    6 |    whlie ( scanf("%d", &k) != EOF) {
      |                                   ^~
      |                                   ;
Language: C

#include <stdio.h>
int data[100], result[100];
int w, i, p=1, s=0;



int main(){
 for(i = 0; i < 100; i++){
  scanf("%d", &data[i]);
  if(data[i] != 0){
   result[s] = data[i];
   s++;
  }
  if(data[i] == 0){
   printf("%d\n", result[s-1]);
   s--;
  }
 }
]

Compiler output:
main.c: In function 'main':
main.c:19:1: error: expected statement before ']' token
   19 | ]
      | ^
main.c:19:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>
int data[100], result[100];
int w, i, p=0, s=0;

int main(){
 for(i = 0; i < 100; i++){
  scanf("%d", &data[i]);
  if(data[i] != 0){
   result[s] = data[i];
   s++;
  }
  if(data[i] == 0){
   printf("%d\n", result[s-1]);
   s--
  }
  p++;
  if(p == 100) break;
 }
}

Compiler output:
main.c: In function 'main':
main.c:14:7: error: expected ';' before '}' token
   14 |    s--
      |       ^
      |       ;
   15 |   }
      |   ~
Language: C

#include <stdio.h>

const int SIZE = 100;
int data[SIZE];
int out[SIZE];
int sp = 0;
int outSp = 0;

int empty(){
    return sp <= 0;
}
void pop(){
    out[outSp] = data[sp];
    outSp++;
    sp--;
}

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

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

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
main.c:5:5: error: variably modified 'out' at file scope
    5 | int out[SIZE];
      |     ^~~
Language: C

#include <stdio.h>

const int SIZE = 100;
int data[SIZE];
int out[SIZE];
int sp = 0;
int outSp = 0;

int empty(){
    return sp <= 0;
}
void pop(){
    out[outSp] = data[sp];
    outSp++;
    sp--;
}

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

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

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
main.c:5:5: error: variably modified 'out' at file scope
    5 | int out[SIZE];
      |     ^~~
Language: C

#include<stdio.h>

const int SIZE = 100; 
int data[SIZE];

int size(int i) {
	return i;
}
int top(int i) {
	return data[i-1];
}
void push(int num,int i) {
	if(num>0) {
		data[i] = num;
		i++;
	}
}

int main() {
	int num,i; 
	for(i = 1;i <= 100;i++) {
		scanf("%d",&num);
		push(num,i);
		if(num==0) {
			printf("%d\n",top(i));
			i -= 2;
		}
	}
	return 0;
}

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
Language: C

#include<stdio.h>

const int SIZE = 100; 
void func() {
int data[SIZE];
}

int size(int i) {
	return i;
}
int top(int i) {
	return data[i-1];
}
void push(int num,int i) {
	if(num>0) {
		data[i] = num;
		i++;
	}
}

int main() {
	int num,i; 
	for(i = 1;i <= 100;i++) {
		scanf("%d",&num);
		push(num,i);
		if(num==0) {
			printf("%d\n",top(i));
			i -= 2;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'top':
main.c:12:16: error: 'data' undeclared (first use in this function)
   12 |         return data[i-1];
      |                ^~~~
main.c:12:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'push':
main.c:16:17: error: 'data' undeclared (first use in this function)
   16 |                 data[i] = num;
      |                 ^~~~
Language: C

#include<stdio.h>

const int SIZE = 100; 
void func() {
int data[SIZE];
}

int size(int i) {
	return i;
}
int top(data(),i) {
	return data[i-1];
}
void push(int num,data(),i) {
	if(num>0) {
		data[i] = num;
		i++;
	}
}

int main() {
	int num,i; 
	for(i = 1;i <= 100;i++) {
		scanf("%d",&num);
		push(num,i);
		if(num==0) {
			printf("%d\n",top(i));
			i -= 2;
		}
	}
	return 0;
}

Compiler output:
main.c:11:9: error: unknown type name 'data'
   11 | int top(data(),i) {
      |         ^~~~
main.c:11:16: error: unknown type name 'i'
   11 | int top(data(),i) {
      |                ^
main.c:14:19: error: unknown type name 'data'
   14 | void push(int num,data(),i) {
      |                   ^~~~
main.c:14:26: error: unknown type name 'i'
   14 | void push(int num,data(),i) {
      |                          ^
main.c: In function 'main':
main.c:25:17: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
   25 |                 push(num,i);
      |                 ^~~~
main.c:27:39: error: implicit declaration of function 'top' [-Wimplicit-function-declaration]
   27 |                         printf("%d\n",top(i));
      |                                       ^~~
Language: C

#include<stdio.h>

const int SIZE = 100; 
int data[SIZE];

int size(int i) {
	return i;
}
int top(int i) {
	return data[i-1];
}
void push(int num,int i) {
	if(num>0) {
		data[i] = num;
		i++;
	}
}

int main() {
	int num,i; 
	for(i=0;i<100;i++) {
		scanf("%d",&num);
		push(num,i);
		if(num==0) {
			printf("%d\n",top(i));
			i -= 2;
		}
	}
	return 0;
}

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int empty(){
    return sp <= 0;
}
int size(){
    return sp;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int v){
     data[sp] = v;
      sp++;
}
int main(){
    int v;
    while(scanf("%d",&v)!=EOF){
        if(v==0){
            pop();
            printf("%d\n",top());
        }else{
            push(v);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int empty(){
    return sp <= 0;
}
int size(){
    return sp;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] = n;
      sp++;
}
int main(){
    int n;
    while(scanf("%d",&v)!=EOF){
        if(n==0){
            pop();
            printf("%d\n",top());
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
main.c: In function 'main':
main.c:23:23: error: 'v' undeclared (first use in this function)
   23 |     while(scanf("%d",&v)!=EOF){
      |                       ^
main.c:23:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int empty(){
    return sp <= 0;
}
int size(){
    return sp;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] = n;
      sp++;
}
int main(){
    int n;
    while(scanf("%d",&n)!=EOF){
        if(n==0){
            printf("%d\n",top());
            pop();
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int empty(){
    return sp <= 0;
}
int size(){
    return sp;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] =n;
      sp++;
}
int main(){
    int n;
    while(scanf("%d",&n)!=???EOF){
        if(n==0){
            printf("%d\n",top());
            pop();
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
main.c: In function 'main':
main.c:23:27: error: expected expression before '?' token
   23 |     while(scanf("%d",&n)!=???EOF){
      |                           ^
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int empty(){
    return sp <= 0;
}
int size(){
    return sp;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] =n;
      sp++;
}
int main(){
  int n;
  while(scanf("%d",&n)!=EOF){
    if(n==0){
      printf("%d\n",top());
      pop();
    }else{
      push(n);
    }
  }
  return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] =n;
      sp++;
}
int main(){
  int n;
  while(scanf("%d",&n)!=EOF){
    if(n==0){
      printf("%d\n",top());
      pop();
    }else{
      push(n);
    }
  }
  return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int n){
     data[sp] =n;
      sp++;
}
int main(){
    int n;
    while(scanf("%d",&n)!=EOF){
        if(n==0){
            printf("%d\n",top());
            pop();
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include<stdio.h>
const int SIZE=100;
int data[SIZE];
int sp=0;
int size(){
    return sp;
}
int empty(){
    return sp<=0;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int v){
    data[sp]=v;
    sp++;
}
int main(){
    int n,k;
    while(scanf("%d",&n)!=EOF){
        if(n==0){
            printf("%d\n",top());
            pop();
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include<stdio.h>

const int SIZE=100;
int data[SIZE];
int sp=0;
int size(){
    return sp;
}
int empty(){
    return sp<=0;
}
int top(){
    return data[sp-1];
}
void pop(){
    sp--;
}
void push(int v){
    data[sp]=v;
    sp++;
}
int main(){
    int n,k;
    while(scanf("%d",&n)!=EOF){
        if(n==0){
            printf("%d\n",top());
            pop();
        }else{
            push(n);
        }
    }
    return 0;
}

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
	const int SIZE = 100;
	int data[SIZE];
	int sp=0;
	
	int empty(){
		return sp <=0;
	}
	
	int top(){
		return data[sp-1];
	}
	
	void pop(){
		sp--;
	}
	
	void push(int v){
		data[sp] = v;
		sp++;
	}
	
	int main(){
		while(1){
			int v;
			scanf("%d",&v);
			if(v==0 && empty()) break;
			if(v!=0){
				push(v);
			} else{
				printf("%d\n",top());
				pop();
			}
		}
	}

Compiler output:
main.c:3:13: error: variably modified 'data' at file scope
    3 |         int data[SIZE];
      |             ^~~~
Language: C

#include<stdio.h>

const int SIZE = 100;
int data[SIZE];
int sp = 0;
int x[100];
int i;
int s = 0;

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

int size(){
	return sp;
}

int isfull(){
	return sp >= SIZE;
}

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

void pop(){
	x[s] = data[sp-1];
	s++;
	sp--;
}
void push(int v){
	data[sp] = v;
	sp++;
}

int main(){
	int v, count = 0;
	for(i = 0;i < 100;i++){
		scanf("%d", &v);
		if(v == 0) pop();
		else {
			push(v);
			count++;
		}
		if(i != 0 && sp == 0) break;
	}
	for(s = 0;s < count;s++){
		printf("%d", x[s]);
	}
	printf("\n");
	return 0;
}

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
Language: C

#include<stdio.h>

const int SIZE = 100;
int data[SIZE];
int sp = 0;
int x[100];
int i;
int s = 0;

void pop(){
	x[s] = data[sp-1];
	s++;
	sp--;
}
void push(int v){
	data[sp] = v;
	sp++;
}

int main(){
	int v, count = 0;
	for(i = 0;i < 100;i++){
		scanf("%d", &v);
		if(v == 0) pop();
		else {
			push(v);
			count++;
		}
		if(i != 0 && sp == 0) break;
	}
	for(s = 0;s < count;s++){
		printf("%d", x[s]);
	}
	printf("\n");
	return 0;
}

Compiler output:
main.c:4:5: error: variably modified 'data' at file scope
    4 | int data[SIZE];
      |     ^~~~
Language: C

#include<stdio.h>

int main(){
	int data[100];
	int sp = 0;
	while(scanf("%d", &v) != EOF){
		if(v != 0){
			data[sp] = v;
			sp++;
		}else{
			sp--;
			printf("%d\n",data[sp]);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:28: error: 'v' undeclared (first use in this function)
    6 |         while(scanf("%d", &v) != EOF){
      |                            ^
main.c:6:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
const int SIZE = 100;
int data[SIZE];
int sp = 0;

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

int size() {
    return sp;
}

int isfull() {
    return sp >= SIZE;
}

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

void pop() {
    sp--;
}

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

int main() {
    int i;
    int comand[100];
    for(i = 0; i < 100; i++) {
        scanf("%d", &comand[i]);
        if(comand[i] != 0) push(comand[i]);
        if(empty()) break;
        if(comand[i] == 0) {
            printf("%d\n", top());
            pop();
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
int SIZE = 100;
int data[SIZE];
int sp = 0;

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

int size() {
    return sp;
}

int isfull() {
    return sp >= SIZE;
}

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

void pop() {
    sp--;
}

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

int main() {
    int i;
    int comand[100];
    for(i = 0; i < 100; i++) {
        scanf("%d", &comand[i]);
        if(comand[i] != 0) push(comand[i]);
        if(empty()) break;
        if(comand[i] == 0) {
            printf("%d\n", top());
            pop();
        }
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[SIZE];
      |     ^~~~
Language: C

#include <stdio.h>
int data[100];
int sp = 0;
 
int empty() {
    return sp <= 0;
}
 
int size() {
    return sp;
}
 
int isfull() {
    return sp >= SIZE;
}
 
int top() {
    return data[sp-1];
}
 
void pop() {
    sp--;
}
 
void push(int v) {
    data[sp] = v;
    sp++;
}
 
int main() {
    int i;
    int comand[100];
    for(i = 0; i < 100; i++) {
        scanf("%d", &comand[i]);
        if(comand[i] != 0) push(comand[i]);
        if(empty()) break;
        if(comand[i] == 0) {
            printf("%d\n", top());
            pop();
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'isfull':
main.c:14:18: error: 'SIZE' undeclared (first use in this function)
   14 |     return sp >= SIZE;
      |                  ^~~~
main.c:14:18: note: each undeclared identifier is reported only once for each function it appears in