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

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class ALDS1_6_A {

    static FastScanner sc = new FastScanner();
    static final int MAX_A = 10000 + 10;
    static int N;
    static int[] A;
    static int[] B;

    public static void main(String[] args) {
        read();
        CountingSort(A, B);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += String.format("%d ", B[i]);
        }
        System.out.println(ans);
    }

    static void CountingSort(int[] A, int[] B) {
        int[] C = new int[MAX_A];

        for (int i = 0; i < N; i++) {
            C[A[i]]++;
        }

        for (int i = 1; i < MAX_A; i++) {
            C[i] += C[i - 1];
        }

        for (int i = N - 1; i >= 0; i--) {
            C[A[i]]--;
            B[C[A[i]]] = A[i];
        }
    }

    static void read() {
        N = Integer.parseInt(sc.next());
        A = new int[N + 10];
        B = new int[N + 10];
        for (int i = 0; i < N; i++) {
            A[i] = Integer.parseInt(sc.next());
        }
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}

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

import java.io.IOException;
import java.util.Scanner;

public class Main{
	public static int n;
	public static int A[];
	public static int B[];
	public static int C[] = new int[10000];
	public static StringBuilder sb = new StringBuilder();

	public static void main(String[] args) throws NumberFormatException, IOException {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		A = new int[n];
		B = new int[n];

		for(int i = 0; i<n ;i++){
			A[i] = scan.nextInt();
			C[A[i]]++;
		}

		for(int i=1;i<10000;i++){
			C[i] = C[i-1]+C[i];
		}

		for(int i = n-1;i>=0;i--){
			B[C[A[i]]-1] = A[i];
			C[A[i]]--;
		}

		for(int i = 0; i < n-1 ;i++){
			sb.append(B[i]?????????);
		}
		System.out.println(sb.toString()+B[n-1]);

	}

}

Compiler output:
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			               ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                 ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                  ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                   ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                    ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                     ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                      ^
Main.java:32: error: illegal start of expression
			sb.append(B[i]?????????);
			                       ^
9 errors
Language: Java

mport java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] in = br.readLine().split(" ");
        int[] A = new int[n];
        //int max = 0;                                                                   
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(in[i]);
        }
        int[] B = new int[n + 1];
        int[] ans = new int[n + 1];
        ans = countingSort(A, B, n);

        StringBuilder sb = new StringBuilder();
        for(int i = 1; i <= n; i++){
            if(i != 1) sb.append(" ");
            sb.append(B[i]);
        }
        System.out.println(sb);

    }
  public static int[] countingSort(int[] A, int[] B, int n){
        int k = 10000 + 1;
        int[] C = new int[k];

        for(int j = 0; j < n; j++){
            C[A[j]]++;
        }

        for(int i = 0; i < k - 1; i++){
            C[i+1] = C[i+1] + C[i];
        }

        for(int j = n - 1; j >= 0; j--){
            B[C[A[j]]] = A[j];
            C[A[j]]--;
        }

        return B;
    }


}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.IOException;
^
3 errors
Language: Java

import java.io.*;

public class Algo21{

	static int count = 0;

	public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		StringBuffer sb = new StringBuffer();
		int max = 0;
		int[] A = new int[n];
		int[] B = new int[n];
		String[] in = br.readLine().split(" ");
		for(int i = 0; i < n; i++){
			A[i] = Integer.parseInt(in[i]);
			max = Math.max(max, A[i]);
		}

		countingSort(A, B, max);
		sb.append(B[0]);
		for(int i = 1; i < n; i++)
			sb.append(" ").append(B[i]);
		System.out.printf("%s\n", sb);
	}

	private static void countingSort(int[] a, int[] b, int max){ // ?¨???°?????????
		int[] C = new int[max+1];

		for(int j = 0; j < a.length; j++){
			C[a[j]]++;
		}

		for(int i = 1; i <= max; i++){
			C[i] = C[i] + C[i-1]; // ?¨???°???
		}

		for(int j = a.length-1; j >= 0; j--){
			b[C[a[j]]-1] = a[j]; // ?¨???°??????????´???°??¨????????????????????????0??????k-1?????§
			C[a[j]]--; // ?????£????????§?¨???°????????????
		}
	}
}

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

import java.io.*;

public class Algo21{

	static int count = 0;

	public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		StringBuilder sb = new StringBuilder();
		int max = 0;
		int[] A = new int[n];
		int[] B = new int[n];
		String[] in = br.readLine().split(" ");
		for(int i = 0; i < n; i++){
			A[i] = Integer.parseInt(in[i]);
			max = Math.max(max, A[i]);
		}

		countingSort(A, B, max);
		sb.append(B[0]);
		for(int i = 1; i < n; i++)
			sb.append(" ").append(B[i]);
		System.out.printf("%s\n", sb);
	}

	private static void countingSort(int[] a, int[] b, int max){ // ?¨???°?????????
		int[] C = new int[max+1];

		for(int j = 0; j < a.length; j++){
			C[a[j]]++;
		}

		for(int i = 1; i <= max; i++){
			C[i] = C[i] + C[i-1]; // ?¨???°???
		}

		for(int j = a.length-1; j >= 0; j--){
			b[C[a[j]]-1] = a[j]; // ?¨???°??????????´???°??¨????????????????????????0??????k-1?????§
			C[a[j]]--; // ?????£????????§?¨???°????????????
		}
	}
}

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

import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for (int i = 0; i < n; i++) {
            A[i] = Integer.parseInt(input[i]);
        }

        int[] B = new int[n];
        countingSort(A, B, 10000);

        StringBuilder sb = new StringBuilder("");
        sb.append(B[0]);
        for (int i = 1; i < B.length; i++) {
            sb.append(" ").append(B[i]);
        }
        System.out.println(sb.toString());
    }

    public static int[] countingSort(int[] A, int[] B, int k) {
        int[] C = new int[k + 1];
        int[] B = new int[A.length];
        int i;
        for (i = 0; i < A.length; i++) {
            C[A[i]]++;
        }
        for (i = 1; i <= k; i++) {
            C[i] += C[i - 1];
        }
        for (i = A.length - 1; i >= 0; i--) {
            B[C[A[i]] - 1] = A[i];
            C[A[i]]--;
        }
        return B;
    }
}

Compiler output:
Main.java:27: error: variable B is already defined in method countingSort(int[],int[],int)
        int[] B = new int[A.length];
              ^
1 error
Language: Java

package aoj;

import java.util.Scanner;

public class ALDS1_6_A {

	static int count = 0;

	public static void main(String[] args) throws Exception {

		Scanner sc = new Scanner(System.in);
		int n  = sc.nextInt();

		int[] A = new int[n];
        int[] B = new int[n];
        int K = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            A[i] = sc.nextInt();
            K = Math.max(K, A[i]);
        }

        CountingSort(A, B, K);

        StringBuilder builder = new StringBuilder();
        builder.append(B[0]);
        for (int i = 1; i < n; i++) {
            builder.append(' ').append(B[i]);
        }
        System.out.println(builder);

	}

	static void CountingSort(int[] a, int[] b, int k) {
		int[] C = new int[k+1];

		for(int i = 0; i < a.length; i++)
			C[a[i]]++;


		for(int i = 1; i <= k; i++)
			C[i] = C[i-1] + C[i];

		for(int i = a.length - 1; i >= 0; i--) {
			C[a[i]]--;
			b[C[a[i]]] = a[i];
 		}
	}
}


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

import java.util.Scanner;

public class ALDS1_6_A {

	static int count = 0;

	public static void main(String[] args) throws Exception {

		Scanner sc = new Scanner(System.in);
		int n  = sc.nextInt();

		int[] A = new int[n];
        int[] B = new int[n];
        int K = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            A[i] = sc.nextInt();
            K = Math.max(K, A[i]);
        }

        CountingSort(A, B, K);

        StringBuilder builder = new StringBuilder();
        builder.append(B[0]);
        for (int i = 1; i < n; i++) {
            builder.append(' ').append(B[i]);
        }
        System.out.println(builder);

	}

	static void CountingSort(int[] a, int[] b, int k) {
		int[] C = new int[k+1];

		for(int i = 0; i < a.length; i++)
			C[a[i]]++;


		for(int i = 1; i <= k; i++)
			C[i] = C[i-1] + C[i];

		for(int i = a.length - 1; i >= 0; i--) {
			C[a[i]]--;
			b[C[a[i]]] = a[i];
 		}
	}
}


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;

public class Main {
	public int cnt = 0;
	public static final BigDecimal TWO = new BigDecimal(2);
	public static final BigDecimal THREE = new BigDecimal(3);

    public Main() {
    }

    public static void main(String[] args ) {
            Main main = new Main();
            main.exec();
    }

    public void exec() {
        BufferedReader bf = null;
        try{
            bf = new BufferedReader(new InputStreamReader(System.in));
            exec_body(bf);
        } catch (IOException e) {
            e.printStackTrace();
        }
        finally{
            if( bf != null ) {
                try {
                    bf.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public void exec_body( BufferedReader bf )  {
    	String line = null;
    		try {
				bf.readLine();
	    			line = bf.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} finally {
			try {
				bf.close();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
		}
    		int[] vals = toIList(line);

    		// 配列の初期化
    		int maxVal = max(vals);
    		int minVal = min(vals);
    		int[] counts = new int[maxVal-minVal+1];
    		for( int ii = 0; ii < counts.length; ii++ ) {
    			counts[ii] = 0;
    		}

    		// 計数
    		for( int ii = 0; ii < vals.length; ii++ ) {
    			int val = vals[ii];
    			counts[val-minVal]++;
    		}

    		// 足す
    		for( int ii = 1; ii < counts.length; ii++ ) {
    			counts[ii] = counts[ii] + counts[ii-1];
    		}

    		// sort処理を行う
    		int[] ans = new int[vals.length];
    		for( int ii = vals.length -1; ii >= 0; ii-- ) {
    			ans[counts[vals[ii]-minVal]-1] = vals[ii];
    			counts[vals[ii]-minVal]--;
    		}

    		print(ans);
    }

    public int max( int[] ary ) {
    		int ret = Integer.MIN_VALUE;
    		for( int ii = 0; ii < ary.length; ii++ ) {
    			if( ret < ary[ii] ) {
    				ret = ary[ii];
    			}
    		}

    		return ret;
    }

    public int min( int[] ary ) {
		int ret = Integer.MAX_VALUE;
		for( int ii = 0; ii < ary.length; ii++ ) {
			if( ret > ary[ii] ) {
				ret = ary[ii];
			}
		}

		return ret;
    }

    public static int[] toIList( String str ) {
        String[] elements = str.split(" ");
        int[] ret = new int [elements.length];
        for( int i = 0; i < elements.length; i++ ) {
            ret[i] = Integer.valueOf(elements[i]);
        }

        return ret;
    }

    public static void print( int[] ary ) {
    		if( ary == null || ary.length == 0 ) {
    			return;
    		}

    		StringBuilder bd = new StringBuilder();
    		for( int i = 0; i < ary.length; i++ ) {
    			if( i != 0 ) {
    				bd.append(" ");
    			}
    			bd.append(ary[i]);
    		}

    		System.out.println(bd.toString());
    }
}


Compiler output:
Main.java:24: error: exception IOException is never thrown in body of corresponding try statement
        } catch (IOException e) {
          ^
1 error
Language: Java

import java.util.Scanner;
public class A {
private static Scanner s;
public static void main(String[] args) {
	s = new Scanner(System.in);
	int a = s.nextInt();
	int[] b = new int[a];
	int l = Integer.MIN_VALUE;

	for(int i = 0;i < a;i++) {
		b[i] = s.nextInt();
		l = Math.max(l, b[i]);
	}
	int[] c = new int[l + 1];
	for(int i = 0;i < a;i++) {
		c[b[i]]++;
	}

	for(int i = 0;i <= l;i++) {
		if(i != 0) {
			c[i] = c[i] + c[i-1];
		}else {
			c[i] = c[i];
		}
	}
	int[] d = new int[a];

	for(int i = a - 1;i >= 0;i--) {
		d[c[b[i]]-1] = b[i];
		c[b[i]]--;
	}
	for(int i = 0;i < a;i++) {
		System.out.print(d[i]);
		if(i != a-1) {
			System.out.print(" ");
		}else {
			System.out.println("");
		}
	}
}
}



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

import java.util.Scanner;
 
public class Main{
 
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        StringBuilder builder = new StringBuilder();
        int[] A = new int[n];
        int[] B = new int[n];
        int K = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            A[i] = scanner.nextInt();
            K = Math.max(K, A[i]);
        }
        CountingSort(A, B, K);
        builder.append(B[0]);
        for (int i = 1; i < n; i++) {
            builder.append(' ').append(B[i]);
        }
        System.out.println(builder);
    }
 
    private void CountingSort(int[] a, int[] b, int k) {
        int[] C = new int[k + 1];
        for (int i = 0; i < a.length; i++)
            C[a[i]]++;
 
        for (int i = 1; i <= k; i++)
            C[i] += C[i - 1];
 
        for (int i = a.length - 1; i >= 0; i--) {
            C[a[i]]--;
            b[C[a[i]]] = a[i];
 
        }
    }
}


Compiler output:
Main.java:16: error: non-static method CountingSort(int[],int[],int) cannot be referenced from a static context
        CountingSort(A, B, K);
        ^
1 error
Language: Java

#include <stdio.h>

#define N 2000001

int B[N], C[N];

void countingSort(int A[], int B[], int k, int n){
  int i, j;

  for(i = 0; i <= k; i++){
    C[i] = 0;
  }
  for(j = 1; j <= n; j++){
    C[A[j]]++;
  }   
  for(i = 1; i <= k; i++){
    C[i] = C[i] + C[i - 1];
  } 
  for(j = n; j >= 1; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

  for(i = 1; i <= n; i++){
    printf("%d", B[i]);
    if(i != n) printf(" ");
  }
  printf("\n");

}

int main(){
  int A[N];
  int i, j, n, k = 0;

  scanf("%d", &n); 
  for(i = 1; i <= n; i++){
    scanf("%d", &A[i]);
    if(k < A[i]) k = A[i];
  }

  countingSort(A, B, k, n);

  return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:3: error: illegal character: '#'
#define N 2000001
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
void countingSort(int A[], int B[], int k, int n){
^
  (use --enable-preview to enable unnamed classes)
Main.java:33: error: not a statement
  int A[N];
        ^
Main.java:33: error: ';' expected
  int A[N];
         ^
Main.java:36: error: illegal start of expression
  scanf("%d", &n); 
              ^
Main.java:38: error: illegal start of expression
    scanf("%d", &A[i]);
                ^
8 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
  static int[] C = new int[10001];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size + 1];

    for (int i = 0; i < size; i++) {
      A[i] = sc.nextInt();
      C[A[i]]++;
    }

    for (int i = 1; i < 10001; i++) {
      C[i] += C[i - 1];
    }

    for (int i = size - 1; i >= 0; i--) {
      B[--C[A[i]]] = A[i];
    }

    System.out.println( Arrays.stream(B).boxed().map(n -> n).collect(joining(", ")));
  }
}



Compiler output:
Main.java:29: error: no suitable method found for collect(Collector<CharSequence,CAP#1,String>)
    System.out.println( Arrays.stream(B).boxed().map(n -> n).collect(joining(", ")));
                                                            ^
    method Stream.<R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super Integer>,BiConsumer<R#1,R#1>) is not applicable
      (cannot infer type-variable(s) R#1
        (actual and formal argument lists differ in length))
    method Stream.<R#2,A>collect(Collector<? super Integer,A,R#2>) is not applicable
      (cannot infer type-variable(s) R#2,A
        (argument mismatch; Collector<CharSequence,CAP#2,String> cannot be converted to Collector<? super Integer,A,R#2>))
  where R#1,T,R#2,A are type-variables:
    R#1 extends Object declared in method <R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super T>,BiConsumer<R#1,R#1>)
    T extends Object declared in interface Stream
    R#2 extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
    A extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends Object from capture of ?
    CAP#2 extends Object from capture of ?
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
  static int[] C = new int[10001];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size + 1];

    for (int i = 0; i < size; i++) {
      A[i] = sc.nextInt();
      C[A[i]]++;
    }

    for (int i = 1; i < 10001; i++) {
      C[i] += C[i - 1];
    }

    for (int i = size - 1; i >= 0; i--) {
      B[--C[A[i]]] = A[i];
    }
    System.out.println( Arrays.stream(B).boxed().map(n -> n).collect(joining(", ")));
  }
}



Compiler output:
Main.java:28: error: no suitable method found for collect(Collector<CharSequence,CAP#1,String>)
    System.out.println( Arrays.stream(B).boxed().map(n -> n).collect(joining(", ")));
                                                            ^
    method Stream.<R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super Integer>,BiConsumer<R#1,R#1>) is not applicable
      (cannot infer type-variable(s) R#1
        (actual and formal argument lists differ in length))
    method Stream.<R#2,A>collect(Collector<? super Integer,A,R#2>) is not applicable
      (cannot infer type-variable(s) R#2,A
        (argument mismatch; Collector<CharSequence,CAP#2,String> cannot be converted to Collector<? super Integer,A,R#2>))
  where R#1,T,R#2,A are type-variables:
    R#1 extends Object declared in method <R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super T>,BiConsumer<R#1,R#1>)
    T extends Object declared in interface Stream
    R#2 extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
    A extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends Object from capture of ?
    CAP#2 extends Object from capture of ?
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
  static int[] C = new int[10001];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size + 1];

    for (int i = 0; i < size; i++) {
      A[i] = sc.nextInt();
      C[A[i]]++;
    }

    for (int i = 1; i < 10001; i++) {
      C[i] += C[i - 1];
    }

    for (int i = size - 1; i >= 0; i--) {
      B[--C[A[i]]] = A[i];
    }
    System.out.println( Arrays.stream(B).boxed().collect(joining(", ")));
  }
}



Compiler output:
Main.java:28: error: no suitable method found for collect(Collector<CharSequence,CAP#1,String>)
    System.out.println( Arrays.stream(B).boxed().collect(joining(", ")));
                                                ^
    method Stream.<R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super Integer>,BiConsumer<R#1,R#1>) is not applicable
      (cannot infer type-variable(s) R#1
        (actual and formal argument lists differ in length))
    method Stream.<R#2,A>collect(Collector<? super Integer,A,R#2>) is not applicable
      (cannot infer type-variable(s) R#2,A
        (argument mismatch; Collector<CharSequence,CAP#2,String> cannot be converted to Collector<? super Integer,A,R#2>))
  where R#1,T,R#2,A are type-variables:
    R#1 extends Object declared in method <R#1>collect(Supplier<R#1>,BiConsumer<R#1,? super T>,BiConsumer<R#1,R#1>)
    T extends Object declared in interface Stream
    R#2 extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
    A extends Object declared in method <R#2,A>collect(Collector<? super T,A,R#2>)
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends Object from capture of ?
    CAP#2 extends Object from capture of ?
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    final static int k = 10000;
  static int[] C = new int[k];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size + 1];

    for (int i = 0; i < size; i++) {
      A[i] = Integer.parseInt(sc.next());
      C[A[i]]++;
    }

    for (int i = 1; i < 10001; i++) {
      C[i] += C[i - 1];
    }

    for (int i = size - 1; i => 0; i--) {
      B[--C[A[i]]] = A[i];
    }
    System.out.println(Arrays.stream(B).boxed().map(n -> n.toString()).collect(joining(" ")));
  }
}



Compiler output:
Main.java:26: error: illegal start of expression
    for (int i = size - 1; i => 0; i--) {
                              ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    final static int k = 10001;
  static int[] C = new int[k];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size];

    for (int i = 0; i < size; i++) {
      A[i] = Integer.parseInt(sc.next());
      C[A[i]]++;
    }

    for (int i = 1; i < k; i++) C[i] += C[i - 1];
    for (int i = size - 1; i >= 0; i--) B[--C[A[i]]] = A[i];
    System.out.println(Arrays.stream(B).map(n -> String.valueOf(n)).collect(joining(" ")));
  }
}



Compiler output:
Main.java:24: error: incompatible types: bad return type in lambda expression
    System.out.println(Arrays.stream(B).map(n -> String.valueOf(n)).collect(joining(" ")));
                                                               ^
    String cannot be converted to int
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    final static int k = 10001;
  static int[] C = new int[k];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size];

    for (int i = 0; i < size; i++) {
      A[i] = Integer.parseInt(sc.next());
      C[A[i]]++;
    }

    for (int i = 1; i < k; i++) C[i] += C[i - 1];
    for (int i = size - 1; i >= 0; i--) B[--C[A[i]]] = A[i];
    System.out.println(Arrays.stream(B).map(n -> n + "").collect(joining(" ")));
  }
}



Compiler output:
Main.java:24: error: incompatible types: bad return type in lambda expression
    System.out.println(Arrays.stream(B).map(n -> n + "").collect(joining(" ")));
                                                   ^
    String cannot be converted to int
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    final static int k = 10001;
  static int[] C = new int[k];

  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size];

    for (int i = 0; i < size; i++) {
      A[i] = Integer.parseInt(sc.next());
      C[A[i]]++;
    }

    for (int i = 1; i < k; i++) C[i] += C[i - 1];
    for (int i = size - 1; i >= 0; i--) B[--C[A[i]]] = A[i];
    System.out.println(Arrays.stream(B).map(n -> new String(n)).collect(joining(" ")));
  }
}



Compiler output:
Main.java:24: error: no suitable constructor found for String(int)
    System.out.println(Arrays.stream(B).map(n -> new String(n)).collect(joining(" ")));
                                                 ^
    constructor String.String(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor String.String(char[]) is not applicable
      (argument mismatch; int cannot be converted to char[])
    constructor String.String(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor String.String(StringBuffer) is not applicable
      (argument mismatch; int cannot be converted to StringBuffer)
    constructor String.String(StringBuilder) is not applicable
      (argument mismatch; int cannot be converted to StringBuilder)
Main.java:24: error: method collect in interface IntStream cannot be applied to given types;
    System.out.println(Arrays.stream(B).map(n -> new String(n)).collect(joining(" ")));
                                                               ^
  required: Supplier<R>,ObjIntConsumer<R>,BiConsumer<R,R>
  found:    Collector<CharSequence,CAP#1,String>
  reason: cannot infer type-variable(s) R
    (actual and formal argument lists differ in length)
  where R is a type-variable:
    R extends Object declared in method <R>collect(Supplier<R>,ObjIntConsumer<R>,BiConsumer<R,R>)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
Main.java:24: error: incompatible types: cannot infer type-variable(s) R
    System.out.println(Arrays.stream(B).map(n -> new String(n)).collect(joining(" ")));
                                                                       ^
    (argument mismatch; Collector<CharSequence,CAP#1,String> cannot be converted to Supplier<R>)
  where R is a type-variable:
    R extends Object declared in method <R>collect(Supplier<R>,ObjIntConsumer<R>,BiConsumer<R,R>)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    final static int k = 10001;
  static int[] C = new int[k];

  public static void main(String... args) {
    InputStreamReader is = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(is);

    int size = Integer.parseInt(br.readLine());
    int current = 0;
    int[] A = new int[size];
    int[] B = new int[size];

    String[] strInputs = br.readLine().split(" ", 0);

    for (int i = 0; i < size; i++) {
      A[i] = Integer.parseInt(strInputs[i]);
      C[A[i]]++;
    }

    for (int i = 1; i < k; i++) C[i] += C[i - 1];
    for (int i = size - 1; i >= 0; i--) B[--C[A[i]]] = A[i];
    System.out.println(Arrays.stream(B).boxed().map(n -> n.toString()).collect(joining(" ")));
  }
}



Compiler output:
Main.java:14: error: unreported exception IOException; must be caught or declared to be thrown
    int size = Integer.parseInt(br.readLine());
                                           ^
Main.java:19: error: unreported exception IOException; must be caught or declared to be thrown
    String[] strInputs = br.readLine().split(" ", 0);
                                    ^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class pr_6_A_counting_sort {
	public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	int n = Integer.parseInt(br.readLine());

        Scanner s = new Scanner(System.in);
        int count = s.nextInt();
        s.nextLine(); // throw away the newline.
        Scanner numScanner = new Scanner(s.nextLine());

		// String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
	    for(int i=0; i<n; i++){
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }	        
	    }
		
		//tmp_arr = br.readLine().split(" ");
		//for(int i=0; i<n;i++){
		//	arr[i] = Integer.parseInt(tmp_arr[i]);
		//}
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		int k = 10001;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class Main {
	public static void main(String[] args) throws IOException {
    	//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	//int n = Integer.parseInt(br.readLine());

        Scanner s = new Scanner(System.in);
        int count = s.nextInt();
        s.nextLine(); // throw away the newline.
        Scanner numScanner = new Scanner(s.nextLine());

		// String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
	    for(int i=0; i<n; i++){
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }	        
	    }
		
		//tmp_arr = br.readLine().split(" ");
		//for(int i=0; i<n;i++){
		//	arr[i] = Integer.parseInt(tmp_arr[i]);
		//}
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		int k = 10001;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:20: error: cannot find symbol
		int arr[] = new int[n];
		                    ^
  symbol:   variable n
  location: class Main
Main.java:22: error: cannot find symbol
	    for(int i=0; i<n; i++){
	                   ^
  symbol:   variable n
  location: class Main
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class pr_6_A_counting_sort {
	public static void main(String[] args) throws IOException {
    	/*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
		tmp_arr = br.readLine().split(" ");
		for(int i=0; i<n;i++){
			arr[i] = Integer.parseInt(tmp_arr[i]);
		}*/
		
        Scanner s = new Scanner(System.in);

        int count = s.nextInt();
        s.nextLine(); // throw away the newline.

        int [] arr = new int[count];
		int k = 10001;
		int [] C = new int[k];
		
        Scanner numScanner = new Scanner(s.nextLine());
        for (int i = 0; i < count; i++) {
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }
        }
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:9: error: class pr_6_A_counting_sort is public, should be declared in a file named pr_6_A_counting_sort.java
public class pr_6_A_counting_sort {
       ^
Main.java:46: error: cannot find symbol
		int C[] = new int[k+1]; // times of appearing (length: k)
		                  ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
Main.java:48: error: cannot find symbol
		for(int i=0; i<k; i++){
		               ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
Main.java:58: error: cannot find symbol
		for(int i=1; i<=k; i++){
		                ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
4 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class pr_6_A_counting_sort {
	public static void main(String[] args) throws IOException {
    	/*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
		tmp_arr = br.readLine().split(" ");
		for(int i=0; i<n;i++){
			arr[i] = Integer.parseInt(tmp_arr[i]);
		}*/
		
        Scanner s = new Scanner(System.in);

        int count = s.nextInt();
        s.nextLine(); // throw away the newline.

        int [] arr = new int[count];
		int k = 10001;
		int [] C = new int[k];
		
        Scanner numScanner = new Scanner(s.nextLine());
        for (int i = 0; i < count; i++) {
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
                C[arr[i]]++;
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }
        }
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:9: error: class pr_6_A_counting_sort is public, should be declared in a file named pr_6_A_counting_sort.java
public class pr_6_A_counting_sort {
       ^
Main.java:47: error: cannot find symbol
		int C[] = new int[k+1]; // times of appearing (length: k)
		                  ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
Main.java:49: error: cannot find symbol
		for(int i=0; i<k; i++){
		               ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
Main.java:59: error: cannot find symbol
		for(int i=1; i<=k; i++){
		                ^
  symbol:   variable k
  location: class pr_6_A_counting_sort
4 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class Main {
	public static void main(String[] args) throws IOException {
    	/*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
		tmp_arr = br.readLine().split(" ");
		for(int i=0; i<n;i++){
			arr[i] = Integer.parseInt(tmp_arr[i]);
		}*/
		
        Scanner s = new Scanner(System.in);

        int count = s.nextInt();
        s.nextLine(); // throw away the newline.

        int [] arr = new int[count];
		int k = 10001;
		int [] C = new int[k];
		
        Scanner numScanner = new Scanner(s.nextLine());
        for (int i = 0; i < count; i++) {
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
                C[arr[i]]++;
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }
        }
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:47: error: cannot find symbol
		int C[] = new int[k+1]; // times of appearing (length: k)
		                  ^
  symbol:   variable k
  location: class Main
Main.java:49: error: cannot find symbol
		for(int i=0; i<k; i++){
		               ^
  symbol:   variable k
  location: class Main
Main.java:59: error: cannot find symbol
		for(int i=1; i<=k; i++){
		                ^
  symbol:   variable k
  location: class Main
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class Main {
	public static void main(String[] args) throws IOException {
    	/*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
		tmp_arr = br.readLine().split(" ");
		for(int i=0; i<n;i++){
			arr[i] = Integer.parseInt(tmp_arr[i]);
		}*/
		
        Scanner s = new Scanner(System.in);

        int count = s.nextInt();
        s.nextLine(); // throw away the newline.

        int [] arr = new int[count];

		int k = 10001;
		int C[] = new int[k];
		
        Scanner numScanner = new Scanner(s.nextLine());
        for (int i = 0; i < count; i++) {
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
                C[arr[i]]++;
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }
        }
		counting_sort(arr);
	}
	
	public static void counting_sort(int[] arr){
		int n = arr.length;
		
		int new_arr[] = new int[n]; // sorted array 
		int C[] = new int[k+1]; // times of appearing (length: k)
		
		for(int i=0; i<k; i++){
			C[i] = 0;
		}
		
		// record appearance
		for(int i=0; i<n; i++){
			C[arr[i]]++;
		}
		
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<=k; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:48: error: cannot find symbol
		int C[] = new int[k+1]; // times of appearing (length: k)
		                  ^
  symbol:   variable k
  location: class Main
Main.java:50: error: cannot find symbol
		for(int i=0; i<k; i++){
		               ^
  symbol:   variable k
  location: class Main
Main.java:60: error: cannot find symbol
		for(int i=1; i<=k; i++){
		                ^
  symbol:   variable k
  location: class Main
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;


public class pr_6_A_counting_sort {
	public static void main(String[] args) throws IOException {
    	/*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		int arr[] = new int[n];
		
		tmp_arr = br.readLine().split(" ");
		for(int i=0; i<n;i++){
			arr[i] = Integer.parseInt(tmp_arr[i]);
		}*/
		
        Scanner s = new Scanner(System.in);

        int count = s.nextInt();
        s.nextLine(); // throw away the newline.

        int [] arr = new int[count];
		int k = 10001;
		int [] C = new int[k];
		
        Scanner numScanner = new Scanner(s.nextLine());
        for (int i = 0; i < count; i++) {
            if (numScanner.hasNextInt()) {
                arr[i] = numScanner.nextInt();
                C[arr[i]]++;
            } else {
                System.out.println("You didn't provide enough numbers");
                break;
            }
        }
		counting_sort(arr, C);
	}
	
	public static void counting_sort(int[] arr, int[] C){
		int n = arr.length;
		int new_arr[] = new int[n]; // sorted array 
				
		// C[i] makes the sum of appearance of the number less than i
		for(int i=1; i<C.length; i++){
			C[i] = C[i] + C[i-1];
		}
			
		for(int i=n-1; i>=0; i--){
			new_arr[C[arr[i]]-1]= arr[i];
			C[arr[i]]--;
		}
		print_array(new_arr);
	}
	
	public static void print_array(int[] arr){
		for(int i=0; i<arr.length; i++){
			System.out.print(arr[i]);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
		}
	}
}



Compiler output:
Main.java:9: error: class pr_6_A_counting_sort is public, should be declared in a file named pr_6_A_counting_sort.java
public class pr_6_A_counting_sort {
       ^
1 error