Language: Java

#include<stdio.h>
#include<stdlib.h>

#define MAX 10000

int n;
void CountingSort(int *A,int *B){
  int i,j;
  int C[MAX+1];
  for(i=0;i<=MAX;i++) C[i]=0;
  for(j=0;j<n;j++) C[A[j]]++;
  for(i=1;i<=MAX;i++) C[i]=C[i]+C[i-1];
  for(j=n-1;j>=0;j--){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }
}
int main(void){
  int *A;
  int *B;
  int i;
  scanf("%d",&n);
  A=malloc((n+1)*sizeof(int));
  B=malloc((n+1)*sizeof(int));
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  CountingSort(A,B);
  for(i=1;i<=n;i++){
    printf("%d",B[i]);
    if(i!=n) printf(" ");
  }
  printf("\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:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:4: error: illegal character: '#'
#define MAX 10000
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
void CountingSort(int *A,int *B){
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: <identifier> expected
void CountingSort(int *A,int *B){
                     ^
Main.java:7: error: class, interface, enum, or record expected
void CountingSort(int *A,int *B){
                         ^
Main.java:9: error: class, interface, enum, or record expected
  int C[MAX+1];
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<=MAX;i++) C[i]=0;
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<=MAX;i++) C[i]=0;
          ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<=MAX;i++) C[i]=0;
                 ^
Main.java:11: error: class, interface, enum, or record expected
  for(j=0;j<n;j++) C[A[j]]++;
  ^
Main.java:11: error: class, interface, enum, or record expected
  for(j=0;j<n;j++) C[A[j]]++;
          ^
Main.java:11: error: class, interface, enum, or record expected
  for(j=0;j<n;j++) C[A[j]]++;
              ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=1;i<=MAX;i++) C[i]=C[i]+C[i-1];
  ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=1;i<=MAX;i++) C[i]=C[i]+C[i-1];
          ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=1;i<=MAX;i++) C[i]=C[i]+C[i-1];
                 ^
Main.java:13: error: class, interface, enum, or record expected
  for(j=n-1;j>=0;j--){
  ^
Main.java:13: error: class, interface, enum, or record expected
  for(j=n-1;j>=0;j--){
            ^
Main.java:13: error: class, interface, enum, or record expected
  for(j=n-1;j>=0;j--){
                 ^
Main.java:15: error: class, interface, enum, or record expected
    C[A[j]]--;
    ^
Main.java:16: error: class, interface, enum, or record expected
  }
  ^
Main.java:20: error: class, interface, enum, or record expected
  int *B;
  ^
Main.java:22: error: class, interface, enum, or record expected
  scanf("%d",&n);
  ^
Main.java:23: error: class, interface, enum, or record expected
  A=malloc((n+1)*sizeof(int));
  ^
Main.java:24: error: class, interface, enum, or record expected
  B=malloc((n+1)*sizeof(int));
  ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0;i<n;i++) scanf("%d",&A[i]);
          ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0;i<n;i++) scanf("%d",&A[i]);
              ^
Main.java:26: error: class, interface, enum, or record expected
  CountingSort(A,B);
  ^
Main.java:27: error: class, interface, enum, or record expected
  for(i=1;i<=n;i++){
  ^
Main.java:27: error: class, interface, enum, or record expected
  for(i=1;i<=n;i++){
          ^
Main.java:27: error: class, interface, enum, or record expected
  for(i=1;i<=n;i++){
               ^
Main.java:29: error: class, interface, enum, or record expected
    if(i!=n) printf(" ");
    ^
Main.java:30: error: class, interface, enum, or record expected
  }
  ^
Main.java:32: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:33: error: class, interface, enum, or record expected
}
^
37 errors