submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s383848435
p00012
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; }
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
s540843748
p00013
Java
rail = [] while line = gets car = line.to_i if car == 0 p rail.pop else rail << car end end
Main.java:1: error: class, interface, enum, or record expected rail = [] ^ 1 error
s106858718
p00013
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); } } } }
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
s555176038
p00013
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); } } }
Main.java:2: error: class aoj0013 is public, should be declared in a file named aoj0013.java public class aoj0013 { ^ 1 error
s403606635
p00013
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); } } }
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
s946067805
p00013
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."); } } }
Main.java:8: error: class prog is public, should be declared in a file named prog.java public class prog { ^ 1 error
s330368198
p00013
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(); } } } }
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
s840262257
p00013
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++; } } } }
Main.java:6: error: cannot find symbol int[] list=new list[10]; ^ symbol: class list location: class Main 1 error
s680594207
p00013
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)); } } }
Main.java:4: error: <identifier> expected private static final scan = Scanner(System.in); ^ 1 error
s248682331
p00013
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)); } } }
Main.java:17: error: cannot find symbol for(int i = size - 1; i >= 0; i++){ ^ symbol: variable size location: class Main 1 error
s629815576
p00013
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)); } } }
Main.java:17: error: variable size might not have been initialized for(int i = size - 1; i >= 0; i++){ ^ 1 error
s865047378
p00013
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; } } } }
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s110276969
p00013
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; } } } }
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s948792016
p00013
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)); } } }
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
s597416127
p00013
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; }
Main.java:43: error: reached end of file while parsing } ^ 1 error
s565062460
p00013
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); } } }
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
s406289448
p00013
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); } } } }
Main.java:4: error: class AOJ0013 is public, should be declared in a file named AOJ0013.java public class AOJ0013 { ^ 1 error
s944080794
p00013
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());}}}
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
s036113667
p00013
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()); } } }
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
s721136869
p00013
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++; } } }
Main.java:1: error: class, interface, enum, or record expected mport java.util.Scanner; ^ 1 error
s170570166
p00013
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); } } } }
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s622041948
p00013
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++; } } }
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
s466016464
p00013
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(); } } }
Main.java:2: error: class, interface, enum, or record expected port java.util.*; ^ 1 error
s607226175
p00013
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; }
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'
s700362452
p00013
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; }
main.c: In function 'main': main.c:4:20: error: expected identifier or '(' before ';' token 4 | int train[10], ; | ^
s894104180
p00013
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; }
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]; | ^
s057404862
p00013
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; }
main.c: In function 'main': main.c:11:38: error: expected ';' before '{' token 11 | }else(n == 0){ | ^ | ;
s163172531
p00013
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; }
main.c: In function 'main': main.c:4:23: error: invalid initializer 4 | int data[10] =0; | ^
s645287032
p00013
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; }
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}; | ^
s245417768
p00013
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); } } } }
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 { | ^~~~
s700096832
p00013
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; }
main.c: In function 'main': main.c:10:28: error: expected ';' before '}' token 10 | k++ | ^ | ; 11 | } else { | ~
s510932529
p00013
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; }
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]): | ^ | ;
s009679708
p00013
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; }
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
s700153310
p00013
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; }
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
s112569162
p00013
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; }
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
s659870287
p00013
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; }
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
s062996735
p00013
C
#include
main.c:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^
s620483345
p00013
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; }
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'
s539334039
p00013
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; }
main.c: In function 'main': main.c:9:34: error: expected ';' before 'i' 9 | in[i]=tmp | ^ | ; 10 | i++; | ~
s708333672
p00013
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; }
main.c: In function 'main': main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
s011909265
p00013
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; }
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; | ^~ | ;
s420169592
p00013
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; }
main.c:1:10: fatal error: Stdio.h: No such file or directory 1 | #include <Stdio.h> | ^~~~~~~~~ compilation terminated.
s110305896
p00013
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; }
main.c: In function 'main': main.c:12:18: error: expected ';' before '}' token 12 | cnt =cnt-1 | ^ | ; 13 | }else{ | ~
s561385153
p00013
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; }
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) { | ^~ | ;
s068352500
p00013
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--; } } ]
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
s123896460
p00013
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; } }
main.c: In function 'main': main.c:14:7: error: expected ';' before '}' token 14 | s-- | ^ | ; 15 | } | ~
s580675234
p00013
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; }
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]; | ^~~
s193602604
p00013
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; }
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]; | ^~~
s074560161
p00013
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; }
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]; | ^~~
s486952434
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s149793978
p00013
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; }
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; | ^~~~
s868727233
p00013
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; }
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)); | ^~~
s463870392
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s930393286
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s759080436
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s923754054
p00013
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; }
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
s190533746
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s378920842
p00013
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; }
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){ | ^
s653253453
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s805460027
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s493438974
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s178257440
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s203202950
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s706776820
p00013
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(); } } }
main.c:3:13: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s632220512
p00013
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(); } } }
main.c:3:13: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s485389113
p00013
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(); } } }
main.c:3:13: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s553807835
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s510281227
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s200422590
p00013
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; }
main.c:4:5: error: variably modified 'data' at file scope 4 | int data[SIZE]; | ^~~~
s731672813
p00013
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; }
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
s687636563
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s153550851
p00013
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; }
main.c:3:5: error: variably modified 'data' at file scope 3 | int data[SIZE]; | ^~~~
s207177512
p00013
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; }
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
s693853923
p00013
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; }
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 | } | ^
s555697727
p00013
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; }
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
s514771581
p00013
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; }
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
s994126469
p00013
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 ] ; }
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 ) | ^~
s844679778
p00013
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; }
main.c: In function 'main': main.c:4:1: error: expected ',' or ';' before 'while' 4 | while(scanf("%d",&a)!=EOF){ | ^~~~~
s622950885
p00013
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; } }
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'
s635604671
p00013
C
n,*a=&n;main(){for(;gets(a);)*a%48?a++:puts(--a);}
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);} | ^
s129696188
p00013
C
n,a=&n;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
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'
s570247060
p00013
C
a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
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'
s747313729
p00013
C
*a=main;main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
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);} | ^
s718450276
p00013
C
a[1];main(){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
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);} | ^~
s457580989
p00013
C
main(i,a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
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'
s397887602
p00013
C
main(i,*a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);}
main.c:1:8: error: expected ')' before '*' token 1 | main(i,*a){for(;~scanf("%s",a);)*a%48?a++:puts(--a);} | ^ | )
s770611649
p00013
C
n,a=&n;main(){for(;~scanf("%s",a++);)*a--%48?:puts(a++);}
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'
s426229637
p00013
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); }
main.c:23:9: error: expected identifier or '(' before 'return' 23 | return (0); | ^~~~~~ main.c:24:1: error: expected identifier or '(' before '}' token 24 | } | ^
s717852580
p00013
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; }
main.c:2:9: fatal error: stack: No such file or directory 2 | #include<stack> | ^~~~~~~ compilation terminated.
s136536284
p00013
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++; } } }
main.c: In function 'main': main.c:7:31: error: expected ';' before '{' token 7 | if(a==0)printf{("%d",car[c]);c--;} | ^ | ;
s935359576
p00013
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; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s135235439
p00013
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; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s157448258
p00013
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); }
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'
s720908989
p00013
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); }
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 | } | ^
s036687490
p00013
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; }
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 | } | ^
s213845705
p00013
C
s,*p=s;main(){for(;gets(p);*p-48?p++:puts(--p));}
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));} | ^
s672692385
p00013
C
s[],p;main(){for(;gets(s);*s-48?p++:puts(s+--p);}
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);} | ^
s834750739
p00013
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; }
main.c:1:10: fatal error: stack: No such file or directory 1 | #include <stack> | ^~~~~~~ compilation terminated.
s250359390
p00013
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; }
main.c: In function 'main': main.c:17:1: error: expected declaration or statement at end of input 17 | } | ^
s007419095
p00013
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; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^