submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s118872183
p00001
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class main { private static int top3[]; public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); top3 = new int[3]; for(int i=0;i<10;i++){ int h = Integer.parseInt(br.readLine()); if(top3[0]<h){ top3[2] = top3[1]; top3[1] = top3[0]; top3[0] = h; } else if(top3[1]<h){ top3[2] = top3[1]; top3[1] = h; }else if(top3[2]<h){ top3[2] =h; } } for(int j=0;j<3;j++){ System.out.println(top3[j]); } } }
Main.java:5: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s381522557
p00001
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class AOJ_Volume0001 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] values = new int[10]; for(int i=0 ; i<10 ;i++){ values[i] = Integer.parseInt(br.readLine()); } Arrays.sort(values); for(int i=9 ; i>6; i--){ System.out.println(values[i]); } } }
Main.java:6: error: class AOJ_Volume0001 is public, should be declared in a file named AOJ_Volume0001.java public class AOJ_Volume0001 { ^ 1 error
s546230404
p00001
Java
import java.util.Scanner; public class AOJ0001{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n[]=new int[10]; int a=0;int b=0;int c=0; for(int i=0;i<10;i++){ n[i] = sc.nextInt(); if(a<n[i]){ b=a; a=n[i]; }else if(b<n[i]){ c=b; b=n[i]; }else if(c<n[i]){ c=n[i]; } } System.out.println(a); System.out.println(b); System.out.println(c); } }
Main.java:2: error: class AOJ0001 is public, should be declared in a file named AOJ0001.java public class AOJ0001{ ^ 1 error
s541228662
p00001
Java
import java.util.*; import java.io.*; public class HillsOfTop3 { public static void main (String args[]) { //ArrayList ar = new ArrayList(); int[] mountain = new int[10]; try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); for (int i = 0; i < 10; i++) { mountain[i] = Integer.parseInt(br.readLine()); } Arrays.sort(mountain); for (int i = 9; i > 6; i--) { System.out.println(mountain[i]); } } catch (IOException e) { e.printStackTrace(); } } }
Main.java:4: error: class HillsOfTop3 is public, should be declared in a file named HillsOfTop3.java public class HillsOfTop3 { ^ 1 error
s929369607
p00001
Java
public class Main{ public static void main(String[] args){ int max = 10, temp; int mountain[] = new mountain[max]; Scanner sc = new Scanner(System.in); for(int i = 0; i < max; i++) mountain[i] = sc.nextInt(); for(int i = 0; i < max; i++){ for(int j = max; j > i; j--){ if(mountain[j-1] > mountain[j]){ temp = mountaim[j-1]; mountain[j-1] = mountain[j]; mountain[j] = temp; } } } for(int i = 0; i < 3; i++) System.out.println(mountain[i]); } }
Main.java:4: error: cannot find symbol int mountain[] = new mountain[max]; ^ symbol: class mountain location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:10: error: cannot find symbol temp = mountaim[j-1]; ^ symbol: variable mountaim location: class Main 4 errors
s957698130
p00001
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int max = 10, temp; int mountain[] = new int[max]; Scanner sc = new Scanner(System.in); for(int i = 0; i < max; i++) mountain[i] = sc.nextInt(); for(int i = 0; i < max; i++){ for(int j = max; j > i; j--){ if(mountain[j-1] > mountain[j]){ temp = mountaim[j-1]; mountain[j-1] = mountain[j]; mountain[j] = temp; } } } for(int i = 0; i < 3; i++) System.out.println(mountain[i]); } }
Main.java:13: error: cannot find symbol temp = mountaim[j-1]; ^ symbol: variable mountaim location: class Main 1 error
s802205017
p00001
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Ideone { public static void main(String[] args) { try (BufferedReader r = new BufferedReader(new InputStreamReader(System.in))) { String line; int[] top3 = new int[3]; while ((line = r.readLine()) != null) { int val = Integer.parseInt(line); if (top3[0] <= val) { top3[2] = top3[1]; top3[1] = top3[0]; top3[0] = val; } else if (top3[1] <= val) { top3[2] = top3[1]; top3[1] = val; } else if (top3[2] <= val) { top3[2] = val; } } for (int t : top3) { System.out.println(t); } } catch (Exception e) { e.getStackTrace(); System.exit(-1); // プログラムを終了 } } }
Main.java:4: error: class Ideone is public, should be declared in a file named Ideone.java public class Ideone { ^ 1 error
s852141208
p00001
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Ideone { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); String line; int[] top3 = new int[3]; while ((line = r.readLine()) != null) { int val = Integer.parseInt(line); if (top3[0] <= val) { top3[2] = top3[1]; top3[1] = top3[0]; top3[0] = val; } else if (top3[1] <= val) { top3[2] = top3[1]; top3[1] = val; } else if (top3[2] <= val) { top3[2] = val; } } for (int t : top3) { System.out.println(t); } } }
Main.java:5: error: class Ideone is public, should be declared in a file named Ideone.java public class Ideone { ^ 1 error
s841499800
p00001
Java
class Main{ public static void main(String[] a){ int m; int n; int l; int o; int p; for(i=0;i<10;i++){ m = Math.max(a[i],a[i+1]); } System.out.println(m); for(i=0;i<10;i++){ n = Math.max(a[i],a[i+1]); } l = Math.min(m,n); System.out.println(l); for(i=0;i<10;i++){ o = Math.max(a[i],a[i+1]); } p = Math.min(n,o); System.out.println(p); } }
Main.java:8: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:8: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:8: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:9: error: cannot find symbol m = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:9: error: cannot find symbol m = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:9: error: no suitable method found for max(String,String) m = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) Main.java:12: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:12: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:12: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol n = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol n = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:13: error: no suitable method found for max(String,String) n = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) Main.java:17: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:17: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:17: error: cannot find symbol for(i=0;i<10;i++){ ^ symbol: variable i location: class Main Main.java:18: error: cannot find symbol o = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:18: error: cannot find symbol o = Math.max(a[i],a[i+1]); ^ symbol: variable i location: class Main Main.java:18: error: no suitable method found for max(String,String) o = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) 18 errors
s036356875
p00001
Java
class Main{ public static void main(String[] a){ int m; int n; int l; int o; int p; for(int i=0;i<10;i++){ m = Math.max(a[i],a[i+1]); } System.out.println(m); for(int i=0;i<10;i++){ n = Math.max(a[i],a[i+1]); } l = Math.min(m,n); System.out.println(l); for(int i=0;i<10;i++){ o = Math.max(a[i],a[i+1]); } p = Math.min(n,o); System.out.println(p); } }
Main.java:9: error: no suitable method found for max(String,String) m = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) Main.java:13: error: no suitable method found for max(String,String) n = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) Main.java:18: error: no suitable method found for max(String,String) o = Math.max(a[i],a[i+1]); ^ method Math.max(int,int) is not applicable (argument mismatch; String cannot be converted to int) method Math.max(long,long) is not applicable (argument mismatch; String cannot be converted to long) method Math.max(float,float) is not applicable (argument mismatch; String cannot be converted to float) method Math.max(double,double) is not applicable (argument mismatch; String cannot be converted to double) 3 errors
s873237534
p00001
Java
import java.util.Scanner; public class ListofTop3Hills { public static void main(String[] a) { Scanner scan = new Scanner(System.in); int[] x=new int[10]; int temp; for(int i=0;i<x.length;i++){ x[i]=scan.nextInt(); } for(int i=0;i<x.length;i++){ for(int j=0;j<x.length;j++){ if(x[i]>x[j]){ temp=x[i]; x[i]=x[j]; x[j]=temp; } } } System.out.println(x[0]); System.out.println(x[1]); System.out.println(x[2]); } }
Main.java:2: error: class ListofTop3Hills is public, should be declared in a file named ListofTop3Hills.java public class ListofTop3Hills { ^ 1 error
s745898514
p00001
Java
import java.util.Scanner; public class main { public static void main(String[] a) { Scanner scan = new Scanner(System.in); int[] x=new int[10]; int temp; for(int i=0;i<x.length;i++){ x[i]=scan.nextInt(); } for(int i=0;i<x.length;i++){ for(int j=0;j<x.length;j++){ if(x[i]>x[j]){ temp=x[i]; x[i]=x[j]; x[j]=temp; } } } System.out.println(x[0]); System.out.println(x[1]); System.out.println(x[2]); } }
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s846733014
p00001
Java
import java.util.Scanner; public class main { /** * @param args */ public static void main(String[] a) { Scanner scan = new Scanner(System.in); int[] x=new int[10]; int temp; for(int i=0;i<x.length;i++){ x[i]=scan.nextInt(); } for(int i=0;i<x.length;i++){ for(int j=0;j<x.length;j++){ if(x[i]>x[j]){ temp=x[i]; x[i]=x[j]; x[j]=temp; } } } System.out.println(x[0]); System.out.println(x[1]); System.out.println(x[2]); } }
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s513633372
p00001
Java
import java.util.Scanner; public class ListofTop3Hills { /** * @param args */ public static void main(String[] a) { Scanner scan = new Scanner(System.in); int[] x=new int[10]; int temp; for(int i=0;i<x.length;i++){ x[i]=scan.nextInt(); } for(int i=0;i<x.length;i++){ for(int j=0;j<x.length;j++){ if(x[i]>x[j]){ temp=x[i]; x[i]=x[j]; x[j]=temp; } } } System.out.println(x[0]); System.out.println(x[1]); System.out.println(x[2]); } }
Main.java:4: error: class ListofTop3Hills is public, should be declared in a file named ListofTop3Hills.java public class ListofTop3Hills { ^ 1 error
s037188454
p00001
Java
public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int a = 0, b = 0, c = 0; for(int i = 0 ; i < 10; i++){ String str = br.readLine(); int input = Integer.parseInt(str); if(input > a){ c = b; b = a; a = input; continue; } if(input > b){ c = b; b = input; continue; } if(input > c){ c = input; continue; } } System.out.println(a); System.out.println(b); System.out.println(c); } }
Main.java:3: error: cannot find symbol public static void main(String[] args) throws IOException{ ^ symbol: class IOException location: class Main Main.java:5: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:5: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:5: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 4 errors
s122337425
p00001
C
#include <stdio.h> int main() { int n, a, b, c, i; a = b = c = 0; for(i=0;i<10;i++) { scanf("%d", &n); if (n>=a) c =b, b = a, a = n; else if (n>=b) c = b, b = n; else (n>c) c = n; } printf("%d\n%d\n%d\n", a, b, c); return (0); }
main.c: In function 'main': main.c:13:27: error: expected ';' before 'c' 13 | else (n>c) | ^ | ; 14 | c = n; | ~
s561665293
p00001
C
#include<stdio.h> #include<conio.h> int main( ) { int a[11]; int i, j, temp, n=10 ; for(j=0; j<n; j++) scanf("%d",&a[j]); for(j=1;j<n;j++) { for(i=0; i < n - 1; i++) { if(a[i]>a[i+1]) { temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; } } } printf("%d\n%d\n%d\n",a[9],a[8],a[7]); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s543463442
p00001
C
#include <bits/stdc++.h> using namespace std; int main() { int arr[10]; for(int i=0; i<10; i++){ cin >> arr[i]; } int l = sizeof(arr)/sizeof(int); sort(arr,arr+10); printf("%d\n%d\n%d\n",arr[9],arr[8],arr[7]); }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s929029147
p00001
C
1819 2003 876 2840 1723 1673 3776 2848 1592 922
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 1819 | ^~~~
s330625075
p00001
C
#include<stdio.h> #include<stdlib.h> int compare_int(int a, int b) { if(a>b){ return -1; } else{ return 1; } } int main(){ int i; int height[10]; for(i=0;i<10;i++){ scanf("%d", height+i); } qsort(height, sizeof(int), compare_int); for(i=0;i<3;i++){ printf("%d\n", height[i]); } return 0; }
main.c: In function 'main': main.c:18:32: error: passing argument 3 of 'qsort' makes integer from pointer without a cast [-Wint-conversion] 18 | qsort(height, sizeof(int), compare_int); | ^~~~~~~~~~~ | | | int (*)(int, int) In file included from main.c:2: /usr/include/stdlib.h:970:57: note: expected 'size_t' {aka 'long unsigned int'} but argument is of type 'int (*)(int, int)' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ~~~~~~~^~~~~~ main.c:18:5: error: too few arguments to function 'qsort' 18 | qsort(height, sizeof(int), compare_int); | ^~~~~ /usr/include/stdlib.h:970:13: note: declared here 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~
s622253511
p00001
C
#include<stdio.h> #include<stdlib.h> int compare_int(const void *a, const void *b) { return *(int*)b - *(int*)a; } int main(){ int i; int height[10]; for(i=0;i<10;i++){ scanf("%d", height+i); } qsort(height, sizeof(int), compare_int); for(i=0;i<3;i++){ printf("%d\n", height[i]); } return 0; }
main.c: In function 'main': main.c:17:32: error: passing argument 3 of 'qsort' makes integer from pointer without a cast [-Wint-conversion] 17 | qsort(height, sizeof(int), compare_int); | ^~~~~~~~~~~ | | | int (*)(const void *, const void *) In file included from main.c:2: /usr/include/stdlib.h:970:57: note: expected 'size_t' {aka 'long unsigned int'} but argument is of type 'int (*)(const void *, const void *)' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ~~~~~~~^~~~~~ main.c:17:5: error: too few arguments to function 'qsort' 17 | qsort(height, sizeof(int), compare_int); | ^~~~~ /usr/include/stdlib.h:970:13: note: declared here 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~
s407365045
p00001
C
#include<iostream> void sort(int *); int main() { int a[10]; for(int i=0;i<10;i++) { scanf("%d",&a[i]); } sort(a); printf("%d\n%d\n%d\n",a[0],a[1],a[2]); } void sort(int *a) { int T; for(int i=0;i<10;i++){ for(int j=i;j<10;j++){ if(a[i]<a[j]){ T=a[i]; a[i]=a[j]; a[j]=T; } } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s653405964
p00001
C
#include <stdio.h> int main(void) { int m[10]; int max1 = 0, max2 = 0, max3 = 0; int i; for (i = 0; i < 10; i++){ scanf("%d", &m[i]); } for (i = 0; i < 10; i++){ if (max1 <= m[i]){ /*max1 = m[i]; max2 = max1;*/ max3 = max2; max2 = max1; max1 = m[i]; } else if (max2 <= m[10]){ max3 = max2; max2 = m[i]; } else if (max3 <= m[10]){ max3 = m[i]; } printf("%d\n%d\n%d\n", max1, max2, max3); return (0); }
main.c: In function 'main': main.c:32:1: error: expected declaration or statement at end of input 32 | } | ^
s043819066
p00001
C
#include <stdio.h> int main() { int mountainList[9]; int highestMount = 0; int secondMount = 0; int thirdMount = 0; int tempMount; for (int c=0; c<=9; c++) { scanf(%d, tempMount); mountainList[c] = tempMount; if (tempMount > highestMount ) { thirdMount = secondMount; secondMount = highestMount; highestMount = tempMount; } else if (tempMount > secondMount) { thirdMount = secondMount; secondMount = tempMount; } else if (tempMount > thirdMount) { thirdMount = tempMount; } } printf("%d\n", highestMount); printf("%d\n", secondMount); printf("%d\n", thirdMount); }
main.c: In function 'main': main.c:11:18: error: expected expression before '%' token 11 | scanf(%d, tempMount); | ^
s314538763
p00001
C
/************* 山の高い順に3つを出力 *************/ #include "stdio.h" #define YAMASU 10 #define SHUTURYOKU 3 int main(void) { int n=0; // 入力 int i,j; // 繰り返し int tmp=0; // 入れ替え  int yama[YAMASU]={0}; // 山の高さを入力(0〜10000の間) do{ printf("山の高さ %d : ",n+1); scanf("%d",&yama[n]); if(yama[n]>=10000 || yama[n]<=0){ printf("0&#12316;10000の間で入力して下さい。\n"); }else{ n++; } }while((yama[n]>=10000 || yama[n]<=0) && n<YAMASU);    // 並べ替え for(i=0;i<YAMASU;i++){ for(j=0;j<YAMASU;j++){ if(yama[i]>yama[j]){ tmp=yama[j]; yama[j]=yama[i]; yama[i]=tmp; } } tmp=0; } // 山の高さが高い順に3つを出力 printf("最も高い山:%d\n",yama[0]); printf("2番目に高い山:%d\n",yama[1]); printf("3番目に高い山:%d\n",yama[2]); return 0; }
main.c: In function 'main': main.c:16:9: error: stray '\343' in program 16 | <U+3000>int yama[YAMASU]={0}; | ^~~~~~~~ main.c:31:1: error: stray '\343' in program 31 | <U+3000><U+3000><U+3000>//<U+3000><U+4E26><U+3079><U+66FF><U+3048> | ^~~~~~~~ main.c:31:3: error: stray '\343' in program 31 | <U+3000><U+3000><U+3000>//<U+3000><U+4E26><U+3079><U+66FF><U+3048> | ^~~~~~~~ main.c:31:5: error: stray '\343' in program 31 | <U+3000><U+3000><U+3000>//<U+3000><U+4E26><U+3079><U+66FF><U+3048> | ^~~~~~~~
s330884472
p00001
C
#include <stdio.h> #define FOR( a,b ) for( a=0;a<b;a++ ) int main(){int mnt[10];int i,j,buf;FOR( i,10 )scanf( "%d",mnt[i] );FOR( i,10 )FOR( i+1,10 )if( mnt[i] < mnt[j] ){ buf=mnt[i];mnt[i]=mnt[j];mnt[j]=buf; };FOR( i,3 )printf( "%d\n",mnt[i] ); return 0;}
main.c: In function 'main': main.c:2:26: error: lvalue required as left operand of assignment 2 | #define FOR( a,b ) for( a=0;a<b;a++ ) | ^ main.c:4:79: note: in expansion of macro 'FOR' 4 | int main(){int mnt[10];int i,j,buf;FOR( i,10 )scanf( "%d",mnt[i] );FOR( i,10 )FOR( i+1,10 )if( mnt[i] < mnt[j] ){ buf=mnt[i];mnt[i]=mnt[j];mnt[j]=buf; };FOR( i,3 )printf( "%d\n",mnt[i] ); return 0;} | ^~~ main.c:2:34: error: lvalue required as increment operand 2 | #define FOR( a,b ) for( a=0;a<b;a++ ) | ^~ main.c:4:79: note: in expansion of macro 'FOR' 4 | int main(){int mnt[10];int i,j,buf;FOR( i,10 )scanf( "%d",mnt[i] );FOR( i,10 )FOR( i+1,10 )if( mnt[i] < mnt[j] ){ buf=mnt[i];mnt[i]=mnt[j];mnt[j]=buf; };FOR( i,3 )printf( "%d\n",mnt[i] ); return 0;} | ^~~
s790723894
p00001
C
#include <stdio.h> #define FOR( a,b ) for( a=0;a<b;a++ ) int main(){ int mnt[10]; int i,j,buf; FOR( i,10 )scanf( "%d",mnt[i] ); FOR( i,10 )FOR( i+1,10 ) if( mnt[i] < mnt[j] ){ buf=mnt[i];mnt[i]=mnt[j];mnt[j]=buf; }; FOR( i,3 )printf( "%d\n",mnt[i] ); return 0; }
main.c: In function 'main': main.c:2:26: error: lvalue required as left operand of assignment 2 | #define FOR( a,b ) for( a=0;a<b;a++ ) | ^ main.c:8:12: note: in expansion of macro 'FOR' 8 | FOR( i,10 )FOR( i+1,10 ) | ^~~ main.c:2:34: error: lvalue required as increment operand 2 | #define FOR( a,b ) for( a=0;a<b;a++ ) | ^~ main.c:8:12: note: in expansion of macro 'FOR' 8 | FOR( i,10 )FOR( i+1,10 ) | ^~~
s255628942
p00001
C
#include<cstdio> #include<algorithm> #include<iostream> using namespace std; int main() { int a[10]; int i,j,k,m,n; for(i=0;i<10;i++) { scanf("%d",&a[i]); } sort(a,a+10); printf("%d\n%d\n%d\n",a[9],a[8],a[7]); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s453968239
p00001
C
#include<cstdio> #include<algorithm> #include<iostream> using namespace std; int main() { int a[10]; int i,j,k,m,n; for(i=0;i<10;i++) { scanf("%d",&a[i]); } sort(a,a+10); printf("%d\n%d\n%d\n",a[9],a[8],a[7]); return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s043923681
p00001
C
include <stdio.h> #include<string.h> #include <stdlib.h> #include <readline/readline.h> #include <readline/history.h> #define BUFSIZ 64 int main (int ac, char **av) { char *prompt = getenv("PS2"); char *line = NULL; int lineSize = 0; int index = 0; int history_no = 0; int mountains[10] = {0}; while (line = readline(NULL)) { lineSize = strlen(line); int x = atoi(line); if (mountains[0] == 0) { mountains[0] = x; } else { for (int idx = 0; idx < 10; idx++) { if (mountains[idx] < x) { memmove(mountains+idx+1, mountains+idx, sizeof(int) * (9-idx)); mountains[idx] = x; break; } } } } for (int i = 0; i < 3; i++) { fprintf(stdout, "%d\n", mountains[i]); } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type na
s610354131
p00001
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <readline/readline.h> #include <readline/history.h> #define BUFSIZ 64 int main (int ac, char **av) { char *prompt = getenv("PS2"); char *line = NULL; int lineSize = 0; int index = 0; int history_no = 0; int mountains[10] = {0}; while (line = readline(NULL)) { lineSize = strlen(line); int x = atoi(line); if (mountains[0] == 0) { mountains[0] = x; } else { for (int idx = 0; idx < 10; idx++) { if (mountains[idx] < x) { memmove(mountains+idx+1, mountains+idx, sizeof(int) * (9-idx)); mountains[idx] = x; break; } } } } for (int i = 0; i < 3; i++) { fprintf(stdout, "%d\n", mountains[i]); } return 0; }
main.c:4:10: fatal error: readline/readline.h: No such file or directory 4 | #include <readline/readline.h> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s967966846
p00001
C
#include<stdio.h> int main(){ int m[10]; int i,j,max=0,n; for(i=0;i<10;i++) scanf("%d"&m[i]); for(j=0;j<3;j++){ for(i=0;i<10;i++){ if(m[i]>=max){ max=m[i]; n=i } } printf("%d\n",max); max=0; m[n]=0; } }
main.c: In function 'main': main.c:7:19: error: invalid operands to binary & (have 'char *' and 'int') 7 | scanf("%d"&m[i]); | ~~~~^~~~~ | | | | | int | char * main.c:12:19: error: expected ';' before '}' token 12 | n=i | ^ | ; 13 | } | ~
s762898258
p00001
C
#include<stdio.h> int main(){ int m[10]; int i,j,max=0,n; for(i=0;i<10;i++) scanf("%d",&m[i]); for(j=0;j<3;j++){ for(i=0;i<10;i++){ if(m[i]>=max){ max=m[i]; n=i } } printf("%d\n",max); max=0; m[n]=0; } }
main.c: In function 'main': main.c:12:19: error: expected ';' before '}' token 12 | n=i | ^ | ; 13 | } | ~
s245546237
p00001
C
#include<stdio.h> int main(void) { int i; int low; int mid; int large; int height[10]; i=0; while(i++ < 10) { scanf("%d", height[i-1]); if(i==1) low = mid = large = height[0]; if(height[i-1] > hi) { hi = height[i-1]; mid = hi; } else if(height[i-1] > mid) { mid = height[i-1]; low = mid; } else if (low > height[i-1]){ low = height[i-1]; } } printf("%d\n%d\n%d\n", hi,mid,low); return 0; }
main.c: In function 'main': main.c:16:22: error: 'hi' undeclared (first use in this function); did you mean 'i'? 16 | if(height[i-1] > hi) { | ^~ | i main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
s690243034
p00001
C
#include<stdio.h> int main(void) { int i; int low; int mid; int large; int height[10]; i=0; while(i++ < 10) { scanf("%d", &(height[i-1])); if(i==1) low = mid = large = height[0]; if(height[i-1] > hi) { hi = height[i-1]; mid = hi; } else if(height[i-1] > mid) { mid = height[i-1]; low = mid; } else if (low > height[i-1]){ low = height[i-1]; } } printf("%d\n%d\n%d\n", hi,mid,low); return 0; }
main.c: In function 'main': main.c:16:22: error: 'hi' undeclared (first use in this function); did you mean 'i'? 16 | if(height[i-1] > hi) { | ^~ | i main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
s822445019
p00001
C
#include<stdio.h> int main(void) { int i; int low; int mid; int large; int height[10]; i=0; while(i++ < 10) { scanf("%d", &(height[i-1])); if(i==1) low = mid = large = height[0]; if(height[i-1] > hi) { large = height[i-1]; mid = large; } else if(height[i-1] > mid) { mid = height[i-1]; low = mid; } else if (low > height[i-1]){ low = height[i-1]; } } printf("%d\n%d\n%d\n", large,mid,low); return 0; }
main.c: In function 'main': main.c:16:22: error: 'hi' undeclared (first use in this function); did you mean 'i'? 16 | if(height[i-1] > hi) { | ^~ | i main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
s339859852
p00001
C
#include <stdio.h> int main(void) { int large; int mid; int low; int input; int i; int height[10]; i = 0; while(i++ < 10) { scanf("%d", &(height[i-1])); if(i==1) low = mid = large = height[0]; if(height[i-1]>large) { large = height[i-1]; } else if(height[i-1]>mid) { mid = heigth[i-1] } else if(height[i-1]>low) { low = height[i-1]; } } printf("%d\n%d\n%d\n", large,mid,low); return 0; }
main.c: In function 'main': main.c:22:13: error: 'heigth' undeclared (first use in this function); did you mean 'height'? 22 | mid = heigth[i-1] | ^~~~~~ | height main.c:22:13: note: each undeclared identifier is reported only once for each function it appears in main.c:22:24: error: expected ';' before '}' token 22 | mid = heigth[i-1] | ^ | ; 23 | } | ~
s017454753
p00001
C
#include <stdio.h> int main(void) { int large; int mid; int low; int input; int i; int height[10]; i = 0; while(i++ < 10) { scanf("%d", &(height[i-1])); if(i==1) low = mid = large = height[0]; if(height[i-1]>large) { large = height[i-1]; } else if(height[i-1]>mid) { mid = height[i-1] } else if(height[i-1]>low) { low = height[i-1]; } } printf("%d\n%d\n%d\n", large,mid,low); return 0; }
main.c: In function 'main': main.c:22:24: error: expected ';' before '}' token 22 | mid = height[i-1] | ^ | ; 23 | } | ~
s910255049
p00001
C
#include<stdio.h> int main(){ int a[10], n; int max = 0; for (int i = 0; i < 10; i++) { scanf_s("%d", &a[i]); } for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (a[j + 1] > a[j]) { max = a[j]; a[j] = a[j + 1]; a[j + 1] = max; } } } printf("%d\n", a[0]); printf("%d\n", a[1]); printf("%d\n", a[2]); return 0; }
main.c: In function 'main': main.c:10:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 10 | scanf_s("%d", &a[i]); | ^~~~~~~ | scanf
s150979296
p00001
C
int main(){ int i,j,x,a[10],b[10]; for (i=1;i<=10;i++) { scanf("%d\n",&a[i]); } x=1; for (j=i;j<=10;j++){ for (i=1;i<=10;i++){ if (a[i]==x) {b[j]=a[i];} } x++; } for (i=8;i<=10;i++) { printf("%d\n",b[i]); return 0; }
main.c: In function 'main': main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d\n",&a[i]); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d\n",&a[i]); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | printf("%d\n",b[i]); | ^~~~~~ main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:15:1: error: expected declaration or statement at end of input 15 | } | ^
s004454064
p00001
C
#include <stdio.h> int main(){ int i,j,x,a[10],b[10]; for (i=1;i<=10;i++) { scanf("%d\n",&a[i]); } x=1; for (j=i;j<=10;j++){ for (i=1;i<=10;i++){ if (a[i]==x) {b[j]=a[i];} } x++; } for (i=8;i<=10;i++) { printf("%d\n",b[i]); return 0; }
main.c: In function 'main': main.c:17:1: error: expected declaration or statement at end of input 17 | } | ^
s439722925
p00001
C
????????????
main.c:1:1: error: expected identifier or '(' before '?' token 1 | ???????????? | ^
s779334430
p00001
C
#include<stdio.h> int main(){ int a,i,j; int a[10]; for(i=0;i<10;i++){ scanf("%d",&a[i]); } for(i=0;i<9;i++){ for(j=0;j<9-i;j++){ if(a[j]<a[j+1]){ int temp =a[j]; a[j]=a[j+1]; a[j+1]=temp; } } } for(i=0;i<3;i++){ printf("%d\n",a[i]); } return 0;
main.c: In function 'main': main.c:4:13: error: conflicting types for 'a'; have 'int[10]' 4 | int a[10]; | ^ main.c:3:13: note: previous declaration of 'a' with type 'int' 3 | int a,i,j; | ^ main.c:20:49: error: expected declaration or statement at end of input 20 | return 0; | ^~~~~~
s883753627
p00001
C
include <stdio.h> int main(void) { int a[10],i,N1,N2,N3; N1=0; N2=0; N3=0; for(i = 0;i < 9; i++){ scanf("%d\n", &a[i]); if(a[i] > N1){ N3=N2; N2=N1; N1=a[i]; } else if(a[i] > N2){ N3=N2; N2=a[i]; } else if(a[i] > N3){ N3=a[i]; } } printf("%d\n%d\n%d\n", N1,N2,N3); return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s277848680
p00001
C
#include <stdio.h> int main(){ int a[10],i,max[3],tmp; for(i=0;i<10;i++){ scanf("%d",&a[i]); if(x>=0 && x<=10000){ i--; } } max[0]=a[0]; max[1]=a[1]; max[2]=a[2]; for(i=3;i<10;i++){ if(max[2]<a[i]){ tmp=a[i]; a[i]=max[2]; max[2]=tmp; if(max[1]<max[2]){ tmp=max[2]; max[2]=max[1]; max[1]=tmp; if(max[0]<max[1]){ tmp=max[0]; max[0]=max[1]; max[1]=tmp; } } } } printf("%d\n%d\n%d\n",max[0],max[1],max[2]); }
main.c: In function 'main': main.c:6:12: error: 'x' undeclared (first use in this function) 6 | if(x>=0 && x<=10000){ | ^ main.c:6:12: note: each undeclared identifier is reported only once for each function it appears in
s505756992
p00001
C
int main(){ int a[10],i,max[3],tmp; for(i=0;i<10;i++){ scanf("%d",&a[i]); if(x<=0 && x>=10000){ i--; } } max[0]=a[0]; max[1]=a[1]; max[2]=a[2]; for(i=3;i<10;i++){ if(max[2]<a[i]){ tmp=a[i]; a[i]=max[2]; max[2]=tmp; if(max[1]<max[2]){ tmp=max[2]; max[2]=max[1]; max[1]=tmp; if(max[0]<max[1]){ tmp=max[0]; max[0]=max[1]; max[1]=tmp; } } } } printf("%d\n%d\n%d\n",max[0],max[1],max[2]); }
main.c: In function 'main': main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d",&a[i]); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d",&a[i]); | ^~~~~ main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:12: error: 'x' undeclared (first use in this function) 5 | if(x<=0 && x>=10000){ | ^ main.c:5:12: note: each undeclared identifier is reported only once for each function it appears in main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 29 | printf("%d\n%d\n%d\n",max[0],max[1],max[2]); | ^~~~~~ main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s283269602
p00001
C
#include<stdio.h> #define NUMBER 10 int main(void){ int i,j,temp,num[NUMBER],count=0; for(i = 0;i < NUMBER;i++){ scanf("%d",&num[i]); } for(i = 0;i < NUMBER;i++){ for(j = 0;j < (NUMBER-1)-i;j++){ if(num[j] > num[j+1]){ temp = num[j]; num[j] = num[j+1]; num[j+1] = temp; } } } for(i = 0;i < NUMBER/2;i++){ temp = num[i]; num[i] = num[(NUMBER-1)-i]; num[N(UMBER-1)-i] = temp; } for(j = 0;j < 3;j++){ printf("%d\n",num[j]); } return 0; }
main.c: In function 'main': main.c:23:21: error: implicit declaration of function 'N' [-Wimplicit-function-declaration] 23 | num[N(UMBER-1)-i] = temp; | ^ main.c:23:23: error: 'UMBER' undeclared (first use in this function); did you mean 'NUMBER'? 23 | num[N(UMBER-1)-i] = temp; | ^~~~~ | NUMBER main.c:23:23: note: each undeclared identifier is reported only once for each function it appears in
s496233910
p00001
C
#include <stdio.h> int comp( const void *c1, const void *c2 ); int main(void){ int a[10],i; for(i=0;i<10;i++){ scanf("%d",&a[i]); } qsort( a, 10, sizeof(int),comp); printf("%d\n%d\n%d\n",a[9],a[8],a[7]); return 0; }
main.c: In function 'main': main.c:8:1: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration] 8 | qsort( a, 10, sizeof(int),comp); | ^~~~~
s020532702
p00001
C
#include<stdio.h> int main(){ int h1 = 0,h2 = 0, h3 = 0,s,input; for(s = 0; s < 10; s++){ if(h1 < input){ h3 = h2; h2 = h1; h1 = input; } else { if(h2 < input){ h3 = h2; h2 = input; } else { if(h3 < input){ h3 = input; } } } printf("%d\n%d\n%d\n",h1,h2,h3); return 0; }
main.c: In function 'main': main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s791039417
p00001
C
#include<stdio.h> int main(){ int h1 = 0,h2 = 0, h3 = 0,s,input; for(s = 0; s < 10; s++){ scanf("%d\n",input); if(h1 < input){ h3 = h2; h2 = h1; h1 = input; } else { if(h2 < input){ h3 = h2; h2 = input; } else { if(h3 < input){ h3 = input; } } } printf("%d\n%d\n%d\n",h1,h2,h3); return 0; }
main.c: In function 'main': main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s512642439
p00001
C
#include<stdio.h> int main(void){ int h1 = 0,h2 = 0, h3 = 0,s,input; for(s = 0; s < 10; s++){ scanf("%d\n",input); if(h1 < input){ h3 = h2; h2 = h1; h1 = input; } else { if(h2 < input){ h3 = h2; h2 = input; } else { if(h3 < input){ h3 = input; } } } printf("%d\n%d\n%d\n",h1,h2,h3); return 0; }
main.c: In function 'main': main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s569055862
p00001
C
#include<stdio.h> int main(void){ int h1 = 0,h2 = 0, h3 = 0,s,input; for(s = 0; s < 10; s++){ scanf("%d\n",input); if(h1 < input){ h3 = h2; h2 = h1; h1 = input; } else { if(h2 < input){ h3 = h2; h2 = input; } else { if(h3 < input){ h3 = input; } } } printf("%d\n%d\n%d\n",h1,h2,h3); return 0; }
main.c: In function 'main': main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s958377544
p00001
C
#include<stdio.h> int main(void){ int h1 = 0,h2 = 0, h3 = 0,s,input; for(s = 0; s =< 10; s++){ scanf("%d\n",input); if(h1 < input){ h3 = h2; h2 = h1; h1 = input; } else { if(h2 < input){ h3 = h2; h2 = input; } else { if(h3 < input){ h3 = input; } } } } printf("%d\n%d\n%d\n",h1,h2,h3); return 0; }
main.c: In function 'main': main.c:5:20: error: expected expression before '<' token 5 | for(s = 0; s =< 10; s++){ | ^
s796796802
p00001
C
#include<stdio.h> int main (void){ int x1=0,x2=0,x3=0,input,s; for(s=0;s<10;s++){ scanf("%d\n",&input); if(x1 < input){ x3 = x2; x2 = x1; x1 = input; }else{ if(x2 < input){ x3 = x2; x2 = input; }else{ if(x3 < input){ x3 = input; } } } } printf("%d\n%d\n%d\n",x1,x2,x3); return(0);
main.c: In function 'main': main.c:22:5: error: expected declaration or statement at end of input 22 | return(0); | ^~~~~~
s664277066
p00001
C
#include<stdio.h> int main(void){ int a[3]={0},i,x; for(i=1;i<=10;i++;){ scanf("%d",&x); if(a[0]<=x){ a[2]=a[1]; a[1]=a[0]; a[0]=x; } else if(a[1]<=x){ a[2]=a[1]; a[1]=x; } else if(a[2]<=x){ a[2]=x; } } printf("%d\n%d\n%d\n",a[0],a[1],a[2]); return 0; }
main.c: In function 'main': main.c:4:22: error: expected ')' before ';' token 4 | for(i=1;i<=10;i++;){ | ~ ^ | )
s585257155
p00001
C
#include <stdio.h> int main(void){ int m[10]; int i; for(i=0; i<10; i++) scanf("%d", &m[i]); int m1, m2, m3; m1=m[0]; for(i=1; i<10 i++){ if(m1<m[i]) m1=m[i]; } if(m1==m[0]) m2=m[1]; else m2=m[0]; for(i=0; i<10; i++){ if(m2<m[i] && m[i]<m1) m2=m[i]; } if(m1!=m[0] && m2!=m[0]) m3=m[0]; else if(m1!=m[1] && m2!=m[1]) m3=m[1]; else m3=m[2]; for(i=0; i<10; i++){ if(m3<m[i] && m[i]<m2) m3=m[i] } printf("%d\n", m1); printf("%d\n", m2); printf("%d\n", m3); return 0; }
main.c: In function 'main': main.c:15:14: error: expected ';' before 'i' 15 | for(i=1; i<10 i++){ | ^~ | ; main.c:44:8: error: expected ';' before '}' token 44 | m3=m[i] | ^ | ; 45 | 46 | } | ~
s129389648
p00001
C
#include <stdio.h> int main(){ int max=0, mid=0, min=0; int h=0; int i=0 for(i=0;i<10;i++){ scanf("%d", &h); if(0>h || h>10000){ printf("error\n"); return 0; } if(max<h){ min=mid; mid=max; max=h; } else if(mid<h){ min=mid; mid=h; } else if(min<h) min=h; } printf("\n"); printf("%d\n%d\n%d\n", max, mid, min); return 0; }
main.c: In function 'main': main.c:6:3: error: expected ',' or ';' before 'for' 6 | for(i=0;i<10;i++){ | ^~~ main.c:6:19: error: expected ';' before ')' token 6 | for(i=0;i<10;i++){ | ^ | ; main.c:6:19: error: expected statement before ')' token
s796130852
p00001
C
#include <stdio.h> int main(){ int max=0; int mid=0; int min=0; int h=0; int i=0 for(i=0;i<10;i++){ scanf("%d", &h); if(0>h || h>10000){ printf("error\n"); return 0; } if(max<h){ min=mid; mid=max; max=h; } else if(mid<h){ min=mid; mid=h; } else if(min<h) min=h; } printf("\n"); printf("%d\n%d\n%d\n", max, mid, min); return 0; }
main.c: In function 'main': main.c:8:3: error: expected ',' or ';' before 'for' 8 | for(i=0;i<10;i++){ | ^~~ main.c:8:19: error: expected ';' before ')' token 8 | for(i=0;i<10;i++){ | ^ | ; main.c:8:19: error: expected statement before ')' token
s516719546
p00001
C
#include<stdio.h> int main(void){ int i; int j; int k; int m=10; int p; int n[10] = { 0 }; for (p = 0; p < 10; p++) scanf_s("%d", &n[p]); if (n[9] < 0){ return 0; } if (n[9] > 10000){ return 0; } else{ for (i = 0; i < m; i++){ for (j = i + 1; j < m; j++){ if (n[i]> n[j]){ k = n[j]; n[j] = n[i]; n[i] = k; } } } } printf("%d %d %d", n[9], n[8], n[7]); return 0; }
main.c: In function 'main': main.c:13:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 13 | scanf_s("%d", &n[p]); | ^~~~~~~ | scanf
s882140323
p00001
C
#include <stdio.h> int main(void) { int indat[10]; int max; int i, j; for (i = 0; i < 10; i++){ scanf_s("%d", &indat[i]); } for (i = 0; i < 3; i++){ max = 0; for (j = 0; j < 10; j++){ if (indat[j] > indat[max]){ max = j; } } printf("%d\n", indat[max]); indat[max] = 0; } return 0; }
main.c: In function 'main': main.c:10:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 10 | scanf_s("%d", &indat[i]); | ^~~~~~~ | scanf
s653157060
p00001
C
#include <stdio.h> int main(){ int a[3]; int b; int i, j, k; for(i = 0; i < 3; i++){ a[i] = 0; } for(i = 0; i < 10; i++){ scanf("%d", &b); for(j = 0; j < 3; j++){ if(a[j] < b){ for(k = j; k < 2; k++){ a[k+1] a[k]; } a[j] = b; break; } } } for(i = 0; i < 3; i++){ printf("%d\n", a[i]); } return 0; }
main.c: In function 'main': main.c:17:27: error: expected ';' before 'a' 17 | a[k+1] a[k]; | ^~ | ;
s317947947
p00001
C
#include<stdio.h> int main(){ int ans[3]; int tmp; for(i=1;i<=10;i++){ int height; scanf("%d",&height); if(height[i-1] <= height[i]){ tmp = height[i-1] height[i] = tmp; } for(i=0;i<=3;i++){ printf("%d\n",height[i]); } return 0; }
main.c: In function 'main': main.c:6:7: error: 'i' undeclared (first use in this function) 6 | for(i=1;i<=10;i++){ | ^ main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in main.c:10:22: error: expected ';' before 'height' 10 | tmp = height[i-1] | ^ | ; 11 | height[i] = tmp; | ~~~~~~ main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
s282375769
p00001
C
#include<stdio.h> int main(){ int ans[3]; int tmp; int i; for(i=1;i<=10;i++){ int height; scanf("%d",&height); if(height[i-1] <= height[i]){ tmp = height[i-1] height[i] = tmp; } for(i=0;i<=3;i++){ printf("%d\n",height[i]); } return 0; }
main.c: In function 'main': main.c:10:14: error: subscripted value is neither array nor pointer nor vector 10 | if(height[i-1] <= height[i]){ | ^ main.c:10:29: error: subscripted value is neither array nor pointer nor vector 10 | if(height[i-1] <= height[i]){ | ^ main.c:11:17: error: subscripted value is neither array nor pointer nor vector 11 | tmp = height[i-1] | ^ main.c:11:22: error: expected ';' before 'height' 11 | tmp = height[i-1] | ^ | ; 12 | height[i] = tmp; | ~~~~~~ main.c:16:25: error: subscripted value is neither array nor pointer nor vector 16 | printf("%d\n",height[i]); | ^ main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^
s941818664
p00001
C
#include<stdio.h> int main(){ int ans[3]; int tmp; int i; for(i=1;i<=10;i++){ int height; scanf("%d",&height); if(height[i-1] <= height[i]){ tmp = height[i-1]; height[i] = tmp; } for(i=0;i<=3;i++){ printf("%d\n",height[i]); } return 0; }
main.c: In function 'main': main.c:10:14: error: subscripted value is neither array nor pointer nor vector 10 | if(height[i-1] <= height[i]){ | ^ main.c:10:29: error: subscripted value is neither array nor pointer nor vector 10 | if(height[i-1] <= height[i]){ | ^ main.c:11:17: error: subscripted value is neither array nor pointer nor vector 11 | tmp = height[i-1]; | ^ main.c:12:11: error: subscripted value is neither array nor pointer nor vector 12 | height[i] = tmp; | ^ main.c:16:25: error: subscripted value is neither array nor pointer nor vector 16 | printf("%d\n",height[i]); | ^ main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^
s590288099
p00001
C
#include<stdio.h> int main (void){ int x1=0,x2=0,x3=0,input,s; for(s=0;s<10;s++){ scanf("%d\n",&input); if(x1 < input){ x3 = x2; x2 = x1; x1 = input; }else{ if(x2 < input){ x3 = x2; x2 = input; }else{ if(x3 < input){ x3 = input; } } } } printf("%d\n%d\n%d\n",x1,x2,x3); return(0);
main.c: In function 'main': main.c:22:5: error: expected declaration or statement at end of input 22 | return(0); | ^~~~~~
s625582875
p00001
C
#include <stdio.h> void swap(int, int); int main(void) { int i, j; int height[10]; for (i = 0; i <= 9; i++) scanf("%d", &height[i]); for (i = 1; i <= 9; i++) for (j = i; j <= 9; j++) if (height[j - 1] <= height[j]) swap(height[j - 1], height[j]); for (i = 0; i < 3; i++) printf("%d", height[i]); return 0; } void swap(int *a, int *b) { int c; c = a; a = b; b = c; }
main.c:22:6: error: conflicting types for 'swap'; have 'void(int *, int *)' 22 | void swap(int *a, int *b) { | ^~~~ main.c:3:6: note: previous declaration of 'swap' with type 'void(int, int)' 3 | void swap(int, int); | ^~~~ main.c: In function 'swap': main.c:24:11: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 24 | c = a; | ^ main.c:26:11: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 26 | b = c; | ^
s517207001
p00001
C
#include <stdio.h> void swap(int, int); int main(void) { int i, j; int height[10]; for (i = 0; i <= 9; i++) scanf("%d", &height[i]); for (i = 1; i <= 9; i++) for (j = i; j <= 9; j++) if (height[j - 1] <= height[j]) swap(height[j - 1], height[j]); for (i = 0; i < 3; i++) printf("%d", height[i]); return 0; } void swap(int *a, int *b) { int c; c = *a; *a = *b; *b = c; }
main.c:22:6: error: conflicting types for 'swap'; have 'void(int *, int *)' 22 | void swap(int *a, int *b) { | ^~~~ main.c:3:6: note: previous declaration of 'swap' with type 'void(int, int)' 3 | void swap(int, int); | ^~~~
s555286730
p00001
C
#include <stdio.h> void swap(int, int); int main(void) { int i, j; int height[10]; for (i = 0; i <= 9; i++) scanf("%d", &height[i]); for (i = 1; i <= 9; i++) for (j = i; j <= 9; j++) if (height[j - 1] <= height[j]) swap(&height[j - 1], &height[j]); for (i = 0; i < 3; i++) printf("%d\n", height[i]); return 0; } void swap(int *a, int *b) { int c; c = *a; *a = *b; *b = c; }
main.c: In function 'main': main.c:15:38: error: passing argument 1 of 'swap' makes integer from pointer without a cast [-Wint-conversion] 15 | swap(&height[j - 1], &height[j]); | ^~~~~~~~~~~~~~ | | | int * main.c:3:11: note: expected 'int' but argument is of type 'int *' 3 | void swap(int, int); | ^~~ main.c:15:54: error: passing argument 2 of 'swap' makes integer from pointer without a cast [-Wint-conversion] 15 | swap(&height[j - 1], &height[j]); | ^~~~~~~~~~ | | | int * main.c:3:16: note: expected 'int' but argument is of type 'int *' 3 | void swap(int, int); | ^~~ main.c: At top level: main.c:22:6: error: conflicting types for 'swap'; have 'void(int *, int *)' 22 | void swap(int *a, int *b) { | ^~~~ main.c:3:6: note: previous declaration of 'swap' with type 'void(int, int)' 3 | void swap(int, int); | ^~~~
s156054169
p00001
C
#include <stdio.h> int main (void) { int a[10]={} int i; for(i=0;i<9;i++) scanf("%d",&a[i]); int k,j; for(i=0;i<8;i++) for(k=0;k<8;k++) if(a[k]<a[k+1]){ j=a[k]; a[k]=a[k+1]; a[k+1]=j; } for(i=0;i<2;i++){ printf("%d",a[i]); putchar('\n'); } return 0; }
main.c: In function 'main': main.c:5:1: error: expected ',' or ';' before 'int' 5 | int i; | ^~~ main.c:6:5: error: 'i' undeclared (first use in this function) 6 | for(i=0;i<9;i++) | ^ main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
s281425431
p00001
C
#include<stdio.h> int main(){ int a[10],i,a,b,c; for(i=0;i<10;i++){ scanf("%d",&a[i]); } for(i=0;i<9;i++){ if(a[i]>a[i+1]) a=a[i]; else a=a[i+1]; } for(i=0;i<9;i++){ if(a[i]>a[i+1] && a[i]<a) b=a[i]; else b=a[i+1]; } for(i=0;i<9;i++){ if(a[i]>a[i+1] && a[i]<b) c=a[i]; else c=a[i+1]; } printf("%d\n",a); printf("%d\n",b); printf("%d\n",c); return 0; }
main.c: In function 'main': main.c:3:13: error: conflicting types for 'a'; have 'int' 3 | int a[10],i,a,b,c; | ^ main.c:3:5: note: previous declaration of 'a' with type 'int[10]' 3 | int a[10],i,a,b,c; | ^
s860283525
p00001
C
#include <stdio.h> int main() { int a,b,c,t1=0,t2=0,t3=0,i; scanf("%d %d",b,c); if(b>=c) t1=b; t2=c; else t1=c; t2=b; for(i=3;i<=10;i++) { scanf("%d",&a); if(a>t1) t1=a; else if(a<t1 && a>t2) t2=a; else if(a<t1 && a<t2 && a>t3) t3=a; } printf("%d\n%d\n%d\n",t1,t2,t3); return 0; }
main.c: In function 'main': main.c:9:9: error: 'else' without a previous 'if' 9 | else t1=c; t2=b; | ^~~~
s372852453
p00001
C
#include <stdio.h> int main (void){ int max[3]={0}; int cont,i; for(i=0;i<10;i++){ scanf("%d",&cont); if(max[0]<cont){ max[2]=max[1]; max[1]=max[0]; max[0]=cont; } else if(max[1]<cont){ max[2]=max[1]; max[1]=cont; } else if(max[2]<cont) max[2]=cont; } for(i=0;i<3;i++) printf("%d\n",max[i]); return (0);
main.c: In function 'main': main.c:21:3: error: expected declaration or statement at end of input 21 | return (0); | ^~~~~~
s393328993
p00001
C
include<stdio.h> void main(){ printf("山の高さ1(整数)\n"); printf("山の高さ2(整数)\n"); printf("山の高さ3(整数)\n"); printf("山の高さ4(整数)\n"); printf("山の高さ5(整数)\n"); printf("山の高さ6(整数)\n"); printf("山の高さ7(整数)\n"); printf("山の高さ8(整数)\n"); printf("山の高さ9(整数)\n"); printf("山の高さ10(整数)\n"); int a[],max1,max2,max3; for(i=0;i<10;i++){ scanf("%d",&a[i]); } max1=a[0]; max2=a[1]; max3=a[2]; for(j=1;j<10;j++){ if(max1<a[j]){ max3=max2; max2=max1; max1=a[j]; } } printf("%d",max1); printf("%d",max2); printf("%d",max3); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s210078056
p00001
C
#include<stdio.h> int main(){ int i,j,k,x; for(i=1;1<=10;i++){ int height of mountain i; scanf("%d",&height of mountain i); } for(k=1;k<=3;k++){ for(j=1;j<=9;j++){ if(height of mountain j>height of mountain j+1){ x=height of mountain j+1 height of mountain j+1=height of mountain j; height of mountain j=x } } } printf("%d\n",height of mountain 10); printf("%d\n",height of mountain 9); printf("%d\n",height of mountain 8); return 0; }
main.c: In function 'main': main.c:6:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'of' 6 | int height of mountain i; | ^~ main.c:6:28: error: unknown type name 'of' main.c:6:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i' 6 | int height of mountain i; | ^ main.c:7:29: error: 'height' undeclared (first use in this function) 7 | scanf("%d",&height of mountain i); | ^~~~~~ main.c:7:29: note: each undeclared identifier is reported only once for each function it appears in main.c:7:35: error: expected ')' before 'of' 7 | scanf("%d",&height of mountain i); | ~ ^~~ | ) main.c:11:26: error: expected ')' before 'of' 11 | if(height of mountain j>height of mountain j+1){ | ~ ^~~ | ) main.c:12:25: error: expected ';' before 'of' 12 | x=height of mountain j+1 | ^~~ | ; main.c:14:23: error: expected ';' before 'of' 14 | height of mountain j=x | ^~~ | ; main.c:18:29: error: expected ')' before 'of' 18 | printf("%d\n",height of mountain 10); | ~ ^~~ | ) main.c:19:29: error: expected ')' before 'of' 19 | printf("%d\n",height of mountain 9); | ~ ^~~ | ) main.c:20:29: error: expected ')' before 'of' 20 | printf("%d\n",height of mountain 8); | ~ ^~~ | )
s242807101
p00001
C
#include <stdio.h> #include <string.h> #include <ctype.h> #include <stdlib.h> #include <math.h> /**------------ SUB ROUTIONE -------------*/ /**------------ SUB ROUTIONE -------------*/ int main() { int i,k,wk; char inp[96]; int dt[10]; int work[10]; /**--init --**/ /**--input--**/ for (i=0 ; i<10 ; i++) { gets(inp); sscanf_s(inp,"%d",&(dt[i])); } /**-- CALC --**/ memcpy(work,dt,sizeof(work)); for (i=0 ; i<9 ; i++) { for (k=0 ; k<9 ; k++) { if (work[k] > work[k+1]) { wk = work[k]; work[k] = work[k+1]; work[k+1] = wk; } } } for (i=9 ; i>6 ; i--) { printf("%d\n",work[i]); } return 0; }
main.c: In function 'main': main.c:22:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 22 | gets(inp); | ^~~~ | fgets main.c:23:17: error: implicit declaration of function 'sscanf_s'; did you mean 'sscanf'? [-Wimplicit-function-declaration] 23 | sscanf_s(inp,"%d",&(dt[i])); | ^~~~~~~~ | sscanf
s462647757
p00001
C
#include <stdio.h> #include <stdlib.h> int comp(const void* a, const void* b){ return *(int*)a - *(int*)b; } int main(){ int i, hei[10] for(i=0;i<10;i++){ scanf("%d", &hei[i]); } qsort(hei, 10, sizeof(int), compare); for(i=0;i<3;i++){ printf("%d\n", hei[i]); } return 0; }
main.c: In function 'main': main.c:10:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for' 10 | for(i=0;i<10;i++){ | ^~~ main.c:10:25: error: expected ';' before ')' token 10 | for(i=0;i<10;i++){ | ^ | ; main.c:10:25: error: expected statement before ')' token main.c:11:30: error: 'hei' undeclared (first use in this function) 11 | scanf("%d", &hei[i]); | ^~~ main.c:11:30: note: each undeclared identifier is reported only once for each function it appears in main.c:14:37: error: 'compare' undeclared (first use in this function); did you mean 'comp'? 14 | qsort(hei, 10, sizeof(int), compare); | ^~~~~~~ | comp
s795876645
p00001
C
#include <stdio.h> #include <stdlib.h> int comp(const void* a, const void* b){ return *(int*)a - *(int*)b; } int main(){ int i, hei[10]; for(i=0;i<10;i++){ scanf("%d", &hei[i]); } qsort(hei, 10, sizeof(int), compare); for(i=0;i<3;i++){ printf("%d\n", hei[i]); } return 0; }
main.c: In function 'main': main.c:14:37: error: 'compare' undeclared (first use in this function); did you mean 'comp'? 14 | qsort(hei, 10, sizeof(int), compare); | ^~~~~~~ | comp main.c:14:37: note: each undeclared identifier is reported only once for each function it appears in
s891132178
p00001
C
#include <stdio.h> #include <stdlib.h> #define MAXN 10 typedef struct DNode { int data; DNode *next; }llist; void creatlist(llist*&head,int a[],int n) { llist *pre,*q; head=(llist *)malloc(sizeof(llist)); pre=head; for(int i=1;i<=n;i++) { q=(llist *)malloc(sizeof(llist)); q->data=a[i]; pre->next=q; pre=q; } pre->next=NULL; } void swapi(llist*&L) { llist *q,*p; q=L->next; p=L->next->next; q->next=NULL; L->next=p; q->next=p->next; p->next=q; } bool sorti(llist*&L) { llist *p,*q; p=L->next; q=L; int count=0,c2; while(p->next!=NULL) { count++; p=p->next; } c2=count; if(L->next->next==NULL&&L->next==NULL) return 0; else { while(count--) { c2=count+1; while(c2--) { if(q->next->data<q->next->next->data) swapi(q); q=q->next; } q=L; } } } int main() { int a[MAXN]; llist *p; for(int i=1;i<=MAXN;i++) scanf("%d",&a[i]); creatlist(p,a,MAXN); sorti(p); for(int i=1;i<=3;i++) { p=p->next; printf("%d\n",p->data); } return 0; }
main.c:7:3: error: unknown type name 'DNode' 7 | DNode *next; | ^~~~~ main.c:9:22: error: expected ';', ',' or ')' before '&' token 9 | void creatlist(llist*&head,int a[],int n) | ^ main.c:23:18: error: expected ';', ',' or ')' before '&' token 23 | void swapi(llist*&L) | ^ main.c:34:1: error: unknown type name 'bool' 34 | bool sorti(llist*&L) | ^~~~ main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include <stdlib.h> +++ |+#include <stdbool.h> 3 | #define MAXN 10 main.c:34:18: error: expected ';', ',' or ')' before '&' token 34 | bool sorti(llist*&L) | ^ main.c: In function 'main': main.c:69:5: error: implicit declaration of function 'creatlist' [-Wimplicit-function-declaration] 69 | creatlist(p,a,MAXN); | ^~~~~~~~~ main.c:70:5: error: implicit declaration of function 'sorti' [-Wimplicit-function-declaration] 70 | sorti(p); | ^~~~~ main.c:73:8: error: assignment to 'llist *' {aka 'struct DNode *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types] 73 | p=p->next; | ^
s988811061
p00001
C
#include <stdio.h> // Sample Input // 1819 // 2003 // 876 // 2840 // 1723 // 1673 // 3776 // 2848 // 1592 // 922 // Output for the Sample Input // 3776 // 2848 // 2840 int main(){ int i = 0, j, num[10], dumy; while(i < 10;){ scanf("%d",&num[i]); for(j = i + 1; j < 10; j++){ if(num[i] > num[j]){ dumy = num[i]; num[i] = num[j]; num[j] = dumy; } } i++; } for(i = 0; i < 10; i++){ printf("%d\n", num[i]); } return 0; }
main.c: In function 'main': main.c:22:21: error: expected ')' before ';' token 22 | while(i < 10;){ | ~ ^ | )
s982892114
p00001
C
#include <stdio.h> // Sample Input // 1819 // 2003 // 876 // 2840 // 1723 // 1673 // 3776 // 2848 // 1592 // 922 // Output for the Sample Input // 3776 // 2848 // 2840 int main(){ int i = 0, j, num[10], dumy; while(i < 10;){ scanf("%d",&num[i]); for(j = i + 1; j < 10; j++){ if(num[i] > num[j]){ dumy = num[i]; num[i] = num[j]; num[j] = dumy; } } i++; } for(i = 0; i < 3; i++){ printf("%d\n", num[i]); } return 0; }
main.c: In function 'main': main.c:22:21: error: expected ')' before ';' token 22 | while(i < 10;){ | ~ ^ | )
s492076158
p00001
C
#include <stdio.h> // Sample Input // 1819 // 2003 // 876 // 2840 // 1723 // 1673 // 3776 // 2848 // 1592 // 922 // Output for the Sample Input // 3776 // 2848 // 2840 int main(){ int i = 0, j, num[10], dumy; while(i < 10;){ scanf("%d",&num[i]); for(j = i + 1; j < 10; j++){ if(num[i] > num[j]){ dumy = num[i]; num[i] = num[j]; num[j] = dumy; } } i++; } for(i = 0; i < 3; i++){ printf("%d\n", num[i]); } return 0; }
main.c: In function 'main': main.c:22:21: error: expected ')' before ';' token 22 | while(i < 10;){ | ~ ^ | )
s605261922
p00001
C
#include<stdio.h> int main(){ int element; int height[10000]; for(int i = 0;;i++){ scanf("%d",&height[i]); if(height[i]!=) { element=i; break; } } return 0; }
main.c: In function 'main': main.c:7:15: error: expected expression before ')' token 7 | if(height[i]!=) { | ^
s977227493
p00001
C
void main () { int number (10); int i, j, a, n; printf("Enter the value \n"); scanf("%d",&n); printf("Enter the numbers \n"); for(i=0;i<n;i++) scanf("%d", &number[i]); for(i=0;i<n;i++) { for (j=i+1;j<n;j++) {if (number [i] <number [j]) { a= number[i]= number[j]; number[j]=a; }}} printf("the numbers arranged in decending" for(i=0;i<n;i++) { printf("%d",number[i]); }}
main.c: In function 'main': main.c:4:17: error: expected declaration specifiers or '...' before numeric constant 4 | int number (10); | ^~ main.c:8:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 8 | printf("Enter the value \n"); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | void main () main.c:8:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 8 | printf("Enter the value \n"); | ^~~~~~ main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:9:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 9 | scanf("%d",&n); | ^~~~~ main.c:9:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:9:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] main.c:9:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:14: error: 'number' undeclared (first use in this function) 13 | scanf("%d", &number[i]); | ^~~~~~ main.c:13:14: note: each undeclared identifier is reported only once for each function it appears in main.c:21:43: error: expected ')' before 'for' 21 | printf("the numbers arranged in decending" | ~ ^ | ) 22 | for(i=0;i<n;i++) | ~~~ main.c:25:2: error: expected ';' before '}' token 25 | }} | ^ | ;
s473408747
p00001
C
#include <stdio.h> int main(){ /*int a,b; for(a=1;a<=9;a++){ for(b=1;b<=9;b++){ printf("%dx%d=%d\n",a,b,a*b); } }*/ int mtop [10]={100,200,300,400,500,600,700,800,900,1000}; */ mtop[0]=1000*/ return 0; }
main.c: In function 'main': main.c:12:4: error: expected expression before '/' token 12 | */ mtop[0]=1000*/ | ^
s220818624
p00001
C
#include<stdio.h> #include<stlib.h> int main() { log long int num1,num2; while(scanf("%d %d",num1,num2)!=EOF){ num=num1*num2; while(num1 !=num2) if(num1>num2) num1=num1-num2; else num2=num2-num1; } printf("%d %d",num1,num2); }
main.c:2:9: fatal error: stlib.h: No such file or directory 2 | #include<stlib.h> | ^~~~~~~~~ compilation terminated.
s431656621
p00001
C
#include<stdio.h> int main() { int i,c,a[11],temp; for(c=0;c<10;c++) scanf("%d",&a[c]); for(i=0;i< 9; i++){ for(j=0; j< 9-i;j++){ if(a[j]>a[j+1]){ temp=a[j+1]; a[j+1]=a[j]; a[j]=temp; } } } printf("%d\n%d\n%d",a[9],a[8],a[7]); return 0; }
main.c: In function 'main': main.c:9:13: error: 'j' undeclared (first use in this function) 9 | for(j=0; j< 9-i;j++){ | ^ main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
s395498563
p00001
C
#include<stdio.h> int main() { int i,c,j,a[11],temp; for(c=0;c<10;c++)scanf("%d",&a[c]); for(i=0;i<9;i++){ for(j=0;j<9 -i;j++){ if(a[j]>a[j+1]){ temp=a[j+1]; a[j+1]=a[j]; a[j]=temp; } } } printf("%d\n%d\n%d\'n",a[9],a[8],a[7]); } return 0; }
main.c:18:1: error: expected identifier or '(' before 'return' 18 | return 0; | ^~~~~~ main.c:19:1: error: expected identifier or '(' before '}' token 19 | } | ^
s312733329
p00001
C
#include<stdio.h> int main() { int i,c,j,a[11],temp; for(c=0;c<10;c++)scanf("%d",&a[c]); for(i=0;i<9;i++){ for(j=0;j<9 -i;j++){ if(a[j]>a[j+1]){ temp=a[j+1]; a[j+1]=a[j]; a[j]=temp; } } } printf("%d\n%d\n%d\'n",a[9],a[8],a[7]); } return 0; }
main.c:18:1: error: expected identifier or '(' before 'return' 18 | return 0; | ^~~~~~ main.c:19:1: error: expected identifier or '(' before '}' token 19 | } | ^
s194656765
p00001
C
#include <iostream> using namespace std; int main() { int height1 = 0; int height2 = 0; int height3 = 0; int x; while (cin >> x){ if (x>=height1){ height1 = x; } else{ if (x>=height2){ height2 = x; } else{ if (x>=height3){ height3 = x; } } } } cout << height1 << endl << height2 << endl << height3 << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s078122892
p00001
C
#include<stdio.h> int main() { int a1[10],i,j,x; for(i=0;i<10;i++) scanf("%d"&a[i]); for(i=9;i>0;i--) for(j=0;j<i;j++) { if(a1[j]<a1[j+1]) { x=a1[j]; a1[j]=a1[j+1]; a1[j+1]=x; } } printf("%d\n%d\n%d\n",a1[0],a1[1],a1[2]); return 0; }
main.c: In function 'main': main.c:8:20: error: 'a' undeclared (first use in this function) 8 | scanf("%d"&a[i]); | ^ main.c:8:20: note: each undeclared identifier is reported only once for each function it appears in
s655198212
p00001
C
int height[10]; void scan(){ for(int i = 0; i < 10; i++){ scanf("%d", &height[i]); } } void sorting(){ for(int numb = 0; numb < 9; numb++){ for(int num = 0; num < 9-numb; num++){ if(height[num] < height[num+1]){ int stock = height[num]; height[num] = height[num+1]; height[num+1] = stock; } } } } int main(){ scan(); sorting(); for(int a = 0; a < 3; a++){ printf("Height%d: %d\n", a, height[a]); } return 0; }
main.c: In function 'scan': main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d", &height[i]); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int height[10]; main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d", &height[i]); | ^~~~~ main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c: In function 'main': main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 25 | printf("Height%d: %d\n", a, height[a]); | ^~~~~~ main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s489327716
p00001
C
#include<stdio.h> int main(){ int i,j,kazu; int max=0,max1=0,max2=0; int x[10]; for(j=0;j<10;j++){ scanf("%d",&kazu); x[i]=kazu; } for(i=0;i<9;i++){ if(i=0){ max=x[i]; max1=x[i]; max2=x[i]; }else{ if(max<x[i]){ max=x[i]; }else if(max1<x[i]){ max1=x[i]; }else if(max2<x[i]){ max2=x[i]; } } printf("%d\n",max); printf("%d\n",max1); printf("%d\n",max2); return 0; }
main.c: In function 'main': main.c:31:1: error: expected declaration or statement at end of input 31 | } | ^
s683500316
p00001
C
#include<stdio.h> int main(){ int i,j,kazu; int max=0,max1=0,max2=0; int x[10]={0}; for(j=0;j<10;j++){ scanf("%d",&kazu); x[i]=kazu; } for(i=0;i<9;i++){ if(i=0){ max=x[i]; max1=x[i]; max2=x[i]; }else{ if(max<x[i]){ max=x[i]; }else if(max1<x[i]){ max1=x[i]; }else if(max2<x[i]){ max2=x[i]; } } printf("%d\n",max); printf("%d\n",max1); printf("%d\n",max2); return 0; }
main.c: In function 'main': main.c:31:1: error: expected declaration or statement at end of input 31 | } | ^
s615269160
p00001
C
#include<stdio.h> int main(){ int i,kazu; int max=0,max1=0,max2=0; int x[10]={0}; for(i=0;i<10;i++){ scanf("%d",&kazu); x[j]=kazu; if(i=0){ max=x[i]; max1=x[i]; max2=x[i]; }else{ if(max<x[i]){ max=x[i]; }else if(max1<x[i]){ max1=x[i]; }else if(max2<x[i]){ max2=x[i]; } } } printf("%d\n",max); printf("%d\n",max1); printf("%d\n",max2); return 0; }
main.c: In function 'main': main.c:10:11: error: 'j' undeclared (first use in this function) 10 | x[j]=kazu; | ^ main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
s405774658
p00001
C
#include <stdio.h> int main(void){ int mountain[10] = {0}; int i=0; int j=0; int k=0; int count=0; int m1=0; int m2=0; int m3=0; for(i=0; i<10; i++){ scanf("%d", &j); mountain[i] = j; } for(i=0; i<10; i++){ j=mountain[i]; while(k<10){ if(j =< mountain[k]){ count++; } k++; } if(count==1){ m1=j; } else if(count==2){ m2=j; } else if(count==3){ m3=j; } k=0; count=0; j=0; } printf("%d\n", m1); printf("%d\n", m2); printf("%d\n", m3); return 0; }
main.c: In function 'main': main.c:22:19: error: expected expression before '<' token 22 | if(j =< mountain[k]){ | ^
s036465121
p00001
C
#include <stdio.h> int main(void){ int mountain[10] = {0}; int i=0; int j=0; int count=0; int m1=0; int m2=0; for(i=0; i<10; i++){ scanf("%d", &j); mountain[i] = j; } do{ count = 0; for(i=0; i<9; i++){ m1 = mountain[i]; m2 = mountain[i+1]; if(m1 < m2){ mountain[i] = m2; mountain[i+1] = m1; count++; } } }while(conut != 0) printf("%d\n", mountain[0]); printf("%d\n", mountain[1]); printf("%d\n", mountain[2]); return 0; }
main.c: In function 'main': main.c:30:12: error: 'conut' undeclared (first use in this function); did you mean 'count'? 30 | }while(conut != 0) | ^~~~~ | count main.c:30:12: note: each undeclared identifier is reported only once for each function it appears in main.c:30:23: error: expected ';' before 'printf' 30 | }while(conut != 0) | ^ | ; 31 | 32 | printf("%d\n", mountain[0]); | ~~~~~~
s232461536
p00001
C
#include <stdio.h> int main(void){ int mountain[10] = {0}; int i=0; int j=0; int count=0; int m1=0; int m2=0; for(i=0; i<10; i++){ scanf("%d", &j); mountain[i] = j; } do{ count = 0; for(i=0; i<9; i++){ m1 = mountain[i]; m2 = mountain[i+1]; if(m1 < m2){ mountain[i] = m2; mountain[i+1] = m1; count++; } } }while(count != 0) printf("%d\n", mountain[0]); printf("%d\n", mountain[1]); printf("%d\n", mountain[2]); return 0; }
main.c: In function 'main': main.c:30:23: error: expected ';' before 'printf' 30 | }while(count != 0) | ^ | ; 31 | 32 | printf("%d\n", mountain[0]); | ~~~~~~
s469789875
p00001
C
#include <stdio.h> int main(void){ int mountain[10] = {0}; int i=0; int j=0; int count=0; int m1=0; int m2=0; for(i=0; i<10; i++){ scanf("%d", &j); mountain[i] = j; } do{ count = 0; for(i=0; i<9; i++){ m1 = mountain[i]; m2 = mountain[i+1]; if(m1 < m2){ mountain[i] = m2; mountain[i+1] = m1; count++; } } }while(count != 0) printf("%d\n", mountain[0]); printf("%d\n", mountain[1]); printf("%d\n", mountain[2]); return 0; }
main.c: In function 'main': main.c:30:23: error: expected ';' before 'printf' 30 | }while(count != 0) | ^ | ; 31 | 32 | printf("%d\n", mountain[0]); | ~~~~~~
s519762568
p00001
C
#include<stdio.h> int main(){ int i,kazu,judge1,judge2; int max=0,max1=0,max2=0; int x[10]; for(i=0;i<10;i++){ scanf("%d",&kazu); x[i]=kazu; } do{ count = 0; for(i=0; i<9; i++){ judge1 = x[i]; judge2 = x[i+1]; if(judge1 < judge2){ x[i] = judge2; x[i+1] = judge1; count++; } } }while(count != 0); printf("%d\n",max); printf("%d\n",max1); printf("%d\n",max2); return 0; }
main.c: In function 'main': main.c:14:7: error: 'count' undeclared (first use in this function) 14 | count = 0; | ^~~~~ main.c:14:7: note: each undeclared identifier is reported only once for each function it appears in
s801573588
p00001
C
#include<stdio.h> int main() { int f=0, s=0, t=0, n, i; for (i=0; i<10; i++){ scanf("%d", &n); if(f<n){ t = s; s = f; f = n; }else if(s<n){ t = s; s = n; }else if(t<n)} t = n; } printf("%d\n%d\n%d\n", f, s, t); return 0; }
main.c: In function 'main': main.c:15:22: error: expected expression before '}' token 15 | }else if(t<n)} | ^ main.c: At top level: main.c:18:13: error: expected declaration specifiers or '...' before string constant 18 | printf("%d\n%d\n%d\n", f, s, t); | ^~~~~~~~~~~~~~ main.c:18:29: error: unknown type name 'f' 18 | printf("%d\n%d\n%d\n", f, s, t); | ^ main.c:18:32: error: unknown type name 's' 18 | printf("%d\n%d\n%d\n", f, s, t); | ^ main.c:18:35: error: unknown type name 't' 18 | printf("%d\n%d\n%d\n", f, s, t); | ^ main.c:19:6: error: expected identifier or '(' before 'return' 19 | return 0; | ^~~~~~ main.c:20:1: error: expected identifier or '(' before '}' token 20 | } | ^