Language: Java

package aoj.sort;

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

public class CountingSort {
	public static void main(String args[]) throws IOException {
		// ??\????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int elementNum = Integer.parseInt(br.readLine());
		String line = br.readLine();
		int[] numArray = parseInt(getSplitLine(line));

		/**
		 * ?????????????即???属?????????
		 */
		// ???????????其
		// 1 ??? n ??? 2,000,000 : ????卒???属
		// 0 ??? A[i] ??? 10,000 : ??????????????卒??属???

		// ????????????????????????????????属???????????????
		// ??属???????????則???+1??則???????????????
		int[] counter = new int[2000000];

		for (int i = 0; i < numArray.length; i++) {
			// numArray?????????????????属?????????????????属????即??????????
			counter[numArray[i]]++;
			// 2, 5, 1, 3, 2, 3, 0 ???????????則????????卒??????
			// counter[0] = 1 ??????0???
			// counter[1] = 1 ??????1???
			// counter[2] = 2 ??????2???
			// counter[3] = 2 ??????3???
			// counter[4] = 0 ??????4???
			// counter[5] = 1 ??????5???
			// ????則?????即???????????????????
		}
		//
		for (int i = 1; i < counter.length; i++) {
			// i ??\?????????????????属????即??????????
			counter[i] = counter[i] + counter[i - 1];
			// i = 0; counter[i] = 1; 0??\??????1???
			// i = 1; counter[i] = 2; 1??\??????2???
			// i = 2; counter[i] = 4; 2??\??????3???
			// i = 3; counter[i] = 6; 3??\??????6???
			// i = 4; counter[i] = 6; 4??\??????6???
			// i = 5; counter[i] = 7; 5??\??????7???
		}

		// output(????????????????????????????????????)????即????????????????????即??????????
		int[] output = new int[2000000];
		for (int i = numArray.length - 1; i >= 0; i--) {
			output[counter[numArray[i]]] = numArray[i];
			counter[numArray[i]]--;
		}

		// for (int i = 0; i < numArray.length; i++) {
		//
		// // output[counter[numArray[i]] - 1] = numArray[i];
		// // // numArray?????????????????属????????卒??????counter??????????????????
		// // // output?????卒?????即??属??????????????????
		// // // 4 = numArray[0]
		// // // 6 = counter[4] - 1????????属???????則?????????即???????即???????????????????????????????????則?????????即?????????????????????
		// // // output[6] = 4 ???numArray[0]????????属??????6??即??????
		// // counter[numArray[i]] = counter[numArray[i]] - 1;
		// // // output?????????????????属?????????????????????????測?????????即???????????属????即??????????
		// // // 6(???????????則????????????) = counter[numarray[0]] = 7 - 1
		// // // 4???counter[4]??????7??????????????即????????????1???????????即?測????6?????????
		// // // 6????????卒???????????即????????????????????????
		// }

		String message = "";
		for (int i = 1; i < output.length; i++) {
			if (i != 1 && output[i] == 0) {
				break;
			}
			message += output[i] + " ";
		}
		System.out.println(message);
	}

	private static String[] getSplitLine(String line) {
		return line.split("\\s");
	}

	private static int[] parseInt(String[] line) {
		int[] numArray = new int[line.length];
		for (int i = 0; i < line.length; i++) {
			numArray[i] = Integer.parseInt(line[i]);
		}
		return numArray;
	}

}

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