Language: Java

#include<stdio.h>
#include<stdlib.h>
#define Max 2000001
#define VMAX 10000
void countingsort(short *,short *,int);
//used template
int main(){
  unsigned short *A,*B;
  int n,i;
  scanf("%d",&n);
  A=(short *)malloc(sizeof(short)*n+1);
  B=(short *)malloc(sizeof(short)*n+1);
  for(i=1;i<n+1;i++){
    scanf("%d",&A[i]);
  }
  countingsort(A,B,n);
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[i]);
  free(A);
  free(B);
  return 0;
}
void countingsort(short *A,short*B,int n){
  int i;
  short C[VMAX+1];
  for(i=0;i<VMAX;i++){
    C[i]=0;
  }
  for(i=1;i<n+1;i++){
    C[A[i]]++;
  }
  for(i=1;i<VMAX;i++){
    C[i]+=C[i-1];
  }
  for(i=n;i>0;i--){
    B[C[A[i]]]=A[i];
    C[A[i]]--;
  }
}



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:3: error: illegal character: '#'
#define Max 2000001
^
Main.java:4: error: illegal character: '#'
#define VMAX 10000
^
Main.java:8: error: not a statement
  unsigned short *A,*B;
  ^
Main.java:8: error: not a statement
  unsigned short *A,*B;
           ^
Main.java:8: error: not a statement
  unsigned short *A,*B;
                  ^
Main.java:8: error: not a statement
  unsigned short *A,*B;
                     ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ';' expected
  unsigned short *A,*B;
          ^
Main.java:8: error: ';' expected
  unsigned short *A,*B;
                ^
Main.java:8: error: ';' expected
  unsigned short *A,*B;
                   ^
Main.java:10: error: illegal start of expression
  scanf("%d",&n);
             ^
Main.java:11: error: '.class' expected
  A=(short *)malloc(sizeof(short)*n+1);
           ^
Main.java:11: error: illegal start of expression
  A=(short *)malloc(sizeof(short)*n+1);
            ^
Main.java:11: error: ';' expected
  A=(short *)malloc(sizeof(short)*n+1);
             ^
Main.java:11: error: '.class' expected
  A=(short *)malloc(sizeof(short)*n+1);
                                ^
Main.java:12: error: '.class' expected
  B=(short *)malloc(sizeof(short)*n+1);
           ^
Main.java:12: error: illegal start of expression
  B=(short *)malloc(sizeof(short)*n+1);
            ^
Main.java:12: error: ';' expected
  B=(short *)malloc(sizeof(short)*n+1);
             ^
Main.java:12: error: '.class' expected
  B=(short *)malloc(sizeof(short)*n+1);
                                ^
Main.java:14: error: illegal start of expression
    scanf("%d",&A[i]);
               ^
Main.java:25: error: <identifier> expected
void countingsort(short *A,short*B,int n){
                       ^
Main.java:25: error: class, interface, enum, or record expected
void countingsort(short *A,short*B,int n){
                           ^
Main.java:27: error: class, interface, enum, or record expected
  short C[VMAX+1];
  ^
Main.java:28: error: class, interface, enum, or record expected
  for(i=0;i<VMAX;i++){
  ^
Main.java:28: error: class, interface, enum, or record expected
  for(i=0;i<VMAX;i++){
          ^
Main.java:28: error: class, interface, enum, or record expected
  for(i=0;i<VMAX;i++){
                 ^
Main.java:30: error: class, interface, enum, or record expected
  }
  ^
Main.java:31: error: class, interface, enum, or record expected
  for(i=1;i<n+1;i++){
          ^
Main.java:31: error: class, interface, enum, or record expected
  for(i=1;i<n+1;i++){
                ^
Main.java:33: error: class, interface, enum, or record expected
  }
  ^
Main.java:34: error: class, interface, enum, or record expected
  for(i=1;i<VMAX;i++){
          ^
Main.java:34: error: class, interface, enum, or record expected
  for(i=1;i<VMAX;i++){
                 ^
Main.java:36: error: class, interface, enum, or record expected
  }
  ^
Main.java:37: error: class, interface, enum, or record expected
  for(i=n;i>0;i--){
          ^
Main.java:37: error: class, interface, enum, or record expected
  for(i=n;i>0;i--){
              ^
Main.java:39: error: class, interface, enum, or record expected
    C[A[i]]--;
    ^
Main.java:40: error: class, interface, enum, or record expected
  }
  ^
40 errors