criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
#define MAX 2000001
#define VMAX 10000

int main()
{
	unsigned short *A, *B;
	
	int C[VMAX + 1];
	int n, i, j;
	scanf("%d", &n);

	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);

	for (i = 0; i <= VMAX; i++) C[i] = 0;


	for (int i = 0; i < n; i++) {
		scanf("%hu", &A[i + 1]);
		C[A[i + 1]]++;
	}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   16 |         A = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:17:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   17 |         B = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
#define MAX 2000001
#define VMAX 10000

int main()
{
	unsigned short *A, *B;
	
	int C[VMAX + 1];
	int n, i, j;
	scanf("%d", &n);

	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);

	for (i = 0; i <= VMAX; i++) C[i] = 0;


	for (int i = 0; i < n; i++) {
		scanf("%hu", &A[i + 1]);
		C[A[i + 1]]++;
	}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   16 |         A = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:17:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   17 |         B = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include<cstdio>
#include<iostream>
#include<stack>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#define _USE_MATH_DEFINES // M_PI????????????????????????
#include<math.h>
#pragma warning(disable:4996)
using namespace std;

#define MAX 2000001
#define VMAX 10000

int main(){
	unsigned short *A, *B;

	int C[VMAX+1];
	int n,i,j;
	cin >> n;

	A = malloc(sizeof(short)*n+1);
	B = malloc(sizeof(short)*n+1);

	for(i=0; i<=VMAX; i++) C[i] = 0;

	for(i=0; i<n; i++){
		cin >> A[i+1];
		C[A[i+1]]++;
	}

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

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

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

	for(i=1; i<=n; i++){
		if(i>1) cout << " ";
		cout << B[i];
	}
	cout << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   23 |         A = malloc(sizeof(short)*n+1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:24:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   24 |         B = malloc(sizeof(short)*n+1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include<iostream>
using namespace std;
const int MAXN = 3000000;
const int MAXA = 20000;

int A[MAXN];
int B[MAXA];
int C[MAXN];

int main()
{
	int n;
	cin >> n;
	memset(C,0,sizeof(C));
	for(int i = 1; i <= n; i++)
	{
		cin >> A[i];
		C[A[i]]++;
	}
	for(int i = 1; i<=MAXA;i++)
		C[i] = C[i]+C[i-1];
		
	for(int i = 1; i<=n;i++)
	{
		B[C[A[i]]] = A[i];
		C[A[i]]--;	
	}
	
	for(int i = 1; i<=n; i++)
	{
		if(i>1) cout << " ";
		cout << B[i];	
	}
	cout << endl;
		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'memset' was not declared in this scope
   14 |         memset(C,0,sizeof(C));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define k 10000
int n;
unsigned short *A, *B;

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

int main(){
	scanf("%d", &n);
	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);
	for(int i = 0;i < n;i++)scanf("%d", &A[i]);
	CountingSort();
	for(int i = 0;i < n - 1;i++)printf("%d ", B[i]);
	printf("%d\n", B[n - 1]);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   22 |         A = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:23:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   23 |         B = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

var n;

function CS(a,b,k){
    var c = new Array(k + 1);
    for(var i = 0;i <= k;i++)
        c[i] = 0;
    for(var j = 0;j < n;j++)
        c[a[j]]++;
    for(var i = 1;i <= k;i++)
        c[i] += c[i - 1];
    for(var j = 0;j < n;j++)
        b[-1 + c[a[j]]--] = a[j];
}

function Main(input){
    input = input.split("\n");
    n = parseInt(input[0],10);
    input[1] = input[1].split(" ");
    var a = Array(n),ans = Array(n);
    for(var i = 0;i < n;i++)
        a[i] = parseInt(input[1][i],10);
    CS(a,ans,10000);
    String(ans);
    var out = ans[0];
    for(i = 1;i < n;i++)
        out += " " + ans[i];
    console.log(out);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));

Compiler output:
a.cc:1:1: error: 'var' does not name a type
    1 | var n;
      | ^~~
a.cc:3:1: error: 'function' does not name a type; did you mean 'union'?
    3 | function CS(a,b,k){
      | ^~~~~~~~
      | union
a.cc:15:1: error: 'function' does not name a type; did you mean 'union'?
   15 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:30:5: error: expected constructor, destructor, or type conversion before '(' token
   30 | Main(require("fs").readFileSync("/dev/stdin","utf8"));
      |     ^
Language: C++

/*#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;*/
#include<stdio.h>
#include<stdlib.h>

#define MAX 2000001
#define VMAX 10000

int main()
{
    unsigned short *A,*B;
    int C[VMAX+1];
    int n,i;
    //cin>>n;
    scanf("%d",&n);
/*
    A=(unsigned short *)malloc(n+1);
    B=(unsigned short *)malloc(n+1);*/
    A=malloc(sizeof(short) * n+1);
    B=malloc(sizeof(short) * n+1);

    for(i=0;i<VMAX;i++)
        C[i]=0;

    for(i=0;i<n;i++)
    {
       // cin>>A[i+1];
       scanf("%hu",&A[i+1]);
        C[A[i+1]]++;
    }

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

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

    for(i=1;i<=n;i++)
    {
        if(i>1) printf(" ");// cout<<" ";
        //cout<<B[i];
        printf("%d",B[i]);
    }
    //cout<<endl;
    printf("\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   21 |     A=malloc(sizeof(short) * n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:22:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   22 |     B=malloc(sizeof(short) * n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main() {
	unsigned short *A, *B;
	int C[VMAX + 1];
	int n, i, j;
	
	scanf("%d", &n);
	
	A = malloc(sizeof(short) * n + 1);
	B = malloc(sizeof(short) * n + 1);
	
	for(i = 0; i <= VMAX; i++) C[i] = 0;
	
	for(i = 0; i < n; i++) {
		scanf("%hu", A[i + 1]);
		C[A[i + 1]]++;
	}
	
	for( i = 1; i <= VMAX; i++) C[i] = C[i] + C[i - 1];
	
	for(j = 1; j <= n; j++) {
		B[C[A[j]]] = A[j];
		C[A[j]] --;
	}
	
	for(i = 1; i <= n; i++) {
		if(i > 1) printf(" ");
		printf("%d", B[i]);
	}
	printf("\n");
	
	return 0;	
	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   13 |         A = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:14:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   14 |         B = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

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

#define Array_MAX 10000

void countingSort(short *A,short *B,int n){
  int i,j;
  int C[Array_MAX+1];

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

int main(){
  unsigned short *A, *B;
  int n,i;

  scanf("%d",&n);
  
  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  for(i=1;i<=n;i++)
    scanf("%hd",&A[i]);
  
  countingSort(A,B,n);

  for(i=1;i<n;i++)
    printf("%hd ",B[i]);
  printf("%hd\n",B[n]);
  
  free(A);
  free(B);
  return 0;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   28 |   A = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   B = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:34:16: error: invalid conversion from 'short unsigned int*' to 'short int*' [-fpermissive]
   34 |   countingSort(A,B,n);
      |                ^
      |                |
      |                short unsigned int*
a.cc:6:26: note:   initializing argument 1 of 'void countingSort(short int*, short int*, int)'
    6 | void countingSort(short *A,short *B,int n){
      |                   ~~~~~~~^
a.cc:34:18: error: invalid conversion from 'short unsigned int*' to 'short int*' [-fpermissive]
   34 |   countingSort(A,B,n);
      |                  ^
      |                  |
      |                  short unsigned int*
a.cc:6:35: note:   initializing argument 2 of 'void countingSort(short int*, short int*, int)'
    6 | void countingSort(short *A,short *B,int n){
      |                            ~~~~~~~^
Language: C++

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

#define Array_MAX 10000

void countingSort(short *A,short *B,int n){
  int i,j;
  int C[Array_MAX+1];

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

int main(){
  unsigned short *A, *B;
  int n,i;

  scanf("%d",&n);
  
  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  for(i=1;i<=n;i++)
    scanf("%hd",&A[i]);
  
  countingSort(A,B,n);

  for(i=1;i<n;i++)
    printf("%hd ",B[i]);
  printf("%hd\n",B[n]);
  
  
  return 0;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   28 |   A = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   B = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:34:16: error: invalid conversion from 'short unsigned int*' to 'short int*' [-fpermissive]
   34 |   countingSort(A,B,n);
      |                ^
      |                |
      |                short unsigned int*
a.cc:6:26: note:   initializing argument 1 of 'void countingSort(short int*, short int*, int)'
    6 | void countingSort(short *A,short *B,int n){
      |                   ~~~~~~~^
a.cc:34:18: error: invalid conversion from 'short unsigned int*' to 'short int*' [-fpermissive]
   34 |   countingSort(A,B,n);
      |                  ^
      |                  |
      |                  short unsigned int*
a.cc:6:35: note:   initializing argument 2 of 'void countingSort(short int*, short int*, int)'
    6 | void countingSort(short *A,short *B,int n){
      |                            ~~~~~~~^
Language: C++

#include <stdio.h>
#include <stdlib.h>
#define MAX 10000

int main(){
  unsigned short *A, *B;

  int C[MAX+1];
  int k, i, j;
  scanf("%d", &k);

  A = malloc(sizeof(short)*k+1);
  B = malloc(sizeof(short)*k+1);

  for ( i = 0; i <= MAX; i++ ) C[i] = 0;

  for ( i = 0; i < k; i++ ){
    scanf("%hu", &A[i + 1]);
    C[A[i + 1]]++;
  }

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

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

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   12 |   A = malloc(sizeof(short)*k+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:13:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   13 |   B = malloc(sizeof(short)*k+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define AMAX 10000

int main()
{
  int n,i,j;
  int c[AMAX+1];
  int *A,*B;

  scanf("%d",&n);

  A=malloc(sizeof(int)*n+1);
  B=malloc(sizeof(int)*n+1);

  for(i=0;i<AMAX;i++){
    c[i]=0;
  }

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

  for(i=1;i<=AMAX;i++){
    c[i]=c[i]+c[i-1];
  }

  for(j=1;j<=n;j++){
    B[c[A[j]]]=A[j];
    c[A[j]]--;
  }

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

  printf("\n");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   14 |   A=malloc(sizeof(int)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc:15:11: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   15 |   B=malloc(sizeof(int)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define VMAX 10000


int main(){
  unsigned short *A,*B;
  int C[VMAX+1];
  int n,i,j;
  scanf("%d",&n);

  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);

  for(i=0;i<=VMAX;i++)C[i]=0;

  for(i=0;i<n;i++){
    scanf("%hu",&A[i+1]);
    C[A[i+1]]++;
  }

  for(i=1;i<=VMAX;i++)C[i]=C[i]+C[i+1];

  for(j=1;j<=n;j++){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }
  
  for(i=1;i<=n;i++){
    if(i>1)printf(" ");
    printf("%d",B[i]);

  }
  
  printf("\n");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   13 |   A=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc:14:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   14 |   B=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define VMAX 10000


int main(){
  unsigned short *A,*B;
  int C[VMAX+1];
  int n,i,j;
  scanf("%d",&n);

  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);

  for(i=0;i<=VMAX;i++)C[i]=0;

  for(i=0;i<n;i++){
    scanf("%hu",&A[i+1]);
    C[A[i+1]]++;
  }

  for(i=1;i<=VMAX;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++){
    if(i>1)printf(" ");
    printf("%d",B[i]);

  }
  
  printf("\n");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   13 |   A=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc:14:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   14 |   B=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include <bits/stdc++.h>
#define N 100000
using namespace std;
int n;
int A[2000010],B[2000010];

void Csort(){
  int cnt[N]={};
  for(int i=0;i<n;i++) cnt[A[i]]++;
  for(int i=1;i<N;i++) cnt[i]+=cnt[i-1];
  for(int i=0;i<n;i++) B[cnt[A[i]]--] = A[i];
}

int main(){
  cin>>n;
  for(int i=0;i<n;i++) scanf("%d",&A[i]);
  for(int i=0;i<n;i++) assert(A[i]<=10000)
  Csort();
  for(int i=1;i<=n;i++){
    if(i>1)printf(" ");
    printf("%d",B[i]);
  }
  cout<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ';' before 'Csort'
   18 |   Csort();
      |   ^~~~~
Language: C++

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

void counting(unsigned short *A,unsigned short*B,int n){
  unsigned short C[10000];
  int i;
  
  for (i=0;i<10000;i++){
    C[i] = 0;
  }
  for(i = 1; i <= n;i++){
    C[A[i]]++;
  }
  for (i =1;i<=n;i++){
    C[i] = C[i] + C[i-1];
  }
  for(i = n;i>0;i--){
    B[C[A[i]]] = A[i];
    C[A[i]]--;
  }
}

int main(void){
  unsigned short *A;
  unsigned short *B;
  int n;
  scanf("%d",&n);
  int i;
  A = malloc(sizeof(short)*n);
  B = malloc(sizeof(short)*n);
  for(i=1;i<=n;i++){
    scanf("%u",&A[i]);
  }
  counting(A,B,n);
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[n]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   A = malloc(sizeof(short)*n);
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:30:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   30 |   B = malloc(sizeof(short)*n);
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

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

void counting(unsigned short *A,unsigned short*B,int n){
  unsigned short C[10000];
  int i;
  
  for (i=0;i<10000;i++){
    C[i] = 0;
  }
  for(i = 1; i <= n;i++){
    C[A[i]]++;
  }
  for (i =1;i<=10000;i++){
    C[i] = C[i] + C[i-1];
  }
  for(i = n;i>0;i--){
    B[C[A[i]]] = A[i];
    C[A[i]]--;
  }
}

int main(void){
  unsigned short *A;
  unsigned short *B;
  int n;
  scanf("%d",&n);
  int i;
  A = malloc(sizeof(short)*n);
  B = malloc(sizeof(short)*n);
  for(i=1;i<=n;i++){
    scanf("%u",&A[i]);
  }
  counting(A,B,n);
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[n]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   A = malloc(sizeof(short)*n);
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:30:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   30 |   B = malloc(sizeof(short)*n);
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

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

void counting(unsigned short *A,unsigned short*B,int n){
  unsigned short C[10000];
  int i;
  
  for (i=0;i<10000;i++){
    C[i] = 0;
  }
  for(i = 1; i <= n;i++){
    C[A[i]]++;
  }
  for (i =1;i<=10000;i++){
    C[i] = C[i] + C[i-1];
  }
  for(i = n;i>0;i--){
    B[C[A[i]]] = A[i];
    C[A[i]]--;
  }
}

int main(){
  unsigned short *A;
  unsigned short *B;
  int n;
  scanf("%d",&n);
  int i;
  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);
  for(i=1;i<=n;i++){
    scanf("%u",&A[i]);
  }
  counting(A,B,n);
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[n]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   A = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:30:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   30 |   B = malloc(sizeof(short)*n+1);
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

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

void counting(unsigned short *A,unsigned short*B,int n){
  int C[10001];
  int i;
  
  for (i=0;i<10001;i++){
    C[i] = 0;
  }
  for(i = 1; i <= n;i++){
    C[A[i]]++;
  }
  for (i =1;i<10001;i++){
    C[i] = C[i] + C[i-1];
  }
  for(i = n;i>0;i--){
    B[C[A[i]]] = A[i];
    C[A[i]]--;
  }
}

int main(){
  unsigned short *A;
  unsigned short *B;
  int n;
  scanf("%d",&n);
  int i;
  A = malloc(sizeof(short)*(n+1));
  B = malloc(sizeof(short)*(n+1));
  for(i=1;i<=n;i++){
    scanf("%hu",&A[i]);
  }
  counting(A,B,n);
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[n]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |   A = malloc(sizeof(short)*(n+1));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:30:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   30 |   B = malloc(sizeof(short)*(n+1));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include<stdio.h>
#define N 2000000
#define Ai 10000
int main(){
  unsigned short *A,*B;
  int i,k=0,n,j;
  int C[Ai+1];
  scanf("%d",&n);
  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);
  for (i = 1;i<=n;i++){
    scanf("%hd",&A[i]);
    if(A[i]>k) k=A[i];
  }
  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-1];
  }
  for(j = n; j>0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<=n;i++) printf("%d",B[i]);
  printf("\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'malloc' was not declared in this scope
    9 |   A=malloc(sizeof(short)*n+1);
      |     ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 | #define N 2000000
Language: C++

#include<stdio.h>
#define N 2000000
#define Ai 10000
int main(){
  unsigned short *A,*B;
  int i,k=0,n,j;
  int C[Ai+1];
  scanf("%d",&n);
  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);
  for (i = 1;i<=n;i++){
    scanf("%hd",&A[i]);
    if(A[i]>k) k=A[i];
  }
  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-1];
  }
  for(j = n; j>0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<=n;i++) printf("%d ",B[i]);
  printf("\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'malloc' was not declared in this scope
    9 |   A=malloc(sizeof(short)*n+1);
      |     ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 | #define N 2000000
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define N 2000000
#define Ai 10000
int main(){
  unsigned short *A,*B;
  int i,k=0,n,j;
  int C[Ai+1];
  scanf("%d",&n);
  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);
  for (i = 1;i<=n;i++){
    scanf("%hd",&A[i]);
    if(A[i]>k) k=A[i];
  }
  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-1];
  }
  for(j = n; j>0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<=n;i++) printf("%d ",B[i]);
  printf("\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   10 |   A=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc:11:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   11 |   B=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define N 2000000
#define Ai 10000
int main(){
  unsigned short *A,*B;
  int i,k=0,n,j;
  int C[Ai+1];
  scanf("%d",&n);
  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);
  for (i = 1;i<=n;i++){
    scanf("%hd",&A[i]);
    if(A[i]>k) k=A[i];
  }
  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-1];
  }
  for(j = n; j>0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<=n;i++){
  if (i>1) printf(" ");  
  printf("%d",B[i]);
  }
  printf("\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   10 |   A=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc:11:11: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   11 |   B=malloc(sizeof(short)*n+1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include <stdio.h>
#include <stdlib.h>
int n;
 int c[10001] = {};

CountingSort(int *a,int *b,int k){
  int i,j;
 
  
  // for(i = 0;i <= k;i++) c[i] = 0;
  
  // printf("\n");
  for(i = 1;i <= k;i++){
    c[i] = c[i] + c[i - 1];
  }

  
  for(j = n;j >= 1;j--){
    // printf("a = %d,b = %d,c = %d\n",a[j],b[c[a[j]]],c[a[j]]);
    b[c[a[j]]] = a[j];
    // printf("a[%d] = %d,b[c[a[%d]]] = %d,c[a[%d]] = %d\n",j,a[j],j,b[c[a[j]]],j,c[a[j]]);
    c[a[j]]--;
  }
}

int main(){
  int i,k = 0;
  int *a,*b;

  scanf("%d",&n);

  a = malloc(sizeof(int) * (n + 1));
  b = malloc(sizeof(int) * (n + 1));

  for(i = 0;i <= n;i++){
    a[i] = 0;
    b[i] = 0;
  }
  
  for(i = 1;i <= n;i++){
    scanf("%d",&a[i]);
    c[a[i]]++;
    if(a[i] > k) k = a[i];
  }
 
  CountingSort(a,b,k);

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

Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'CountingSort' with no type [-fpermissive]
    6 | CountingSort(int *a,int *b,int k){
      | ^~~~~~~~~~~~
a.cc: In function 'int CountingSort(int*, int*, int)':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
a.cc: In function 'int main()':
a.cc:32:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   32 |   a = malloc(sizeof(int) * (n + 1));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:33:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   33 |   b = malloc(sizeof(int) * (n + 1));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include<stdio.h>
#define MAX 2000000
#define VMAX 10000
int A[MAX],B[MAX];
int C[VMAX + 1];
int n;

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

int main(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &A[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'void CountingSort(int*, int*, int)':
a.cc:14:21: error: 'j' was not declared in this scope
   14 |                 C[A[j]]++
      |                     ^
a.cc:20:23: error: 'j' was not declared in this scope
   20 |                 B[C[A[j]]] = A[j];
      |                       ^
Language: C++

#include<stdio.h>
#define MAX 2000000
#define VMAX 10000
int A[MAX],B[MAX];
int C[VMAX + 1];
int n;

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

int main(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &A[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'void CountingSort(int*, int*, int)':
a.cc:14:21: error: 'j' was not declared in this scope
   14 |                 C[A[j]]++
      |                     ^
Language: C++

#include<stdio.h>
#define MAX 2000000
#define VMAX 10000
int A[MAX],B[MAX];
int C[VMAX + 1];
int n;

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

int main(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &A[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'void CountingSort(int*, int*, int)':
a.cc:14:26: error: expected ';' before '}' token
   14 |                 C[A[i]]++
      |                          ^
      |                          ;
   15 |         }
      |         ~
Language: C++

#include<stdio.h>
#define MAX 2000000
#define VMAX 10000
int A[MAX],B[MAX];
int C[VMAX + 1];
int n;

void CountingSort(int A[], int B[], int k){
	int i;
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (i = 0; i < n; i++){
		C[A[i+1]]++
	}
	for (i = 0; i < k; i++){
		C[i] += C[i + 1];
	}
	for (i = 1; i <= n; i++){
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int main(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'void CountingSort(int*, int*, int)':
a.cc:14:28: error: expected ';' before '}' token
   14 |                 C[A[i+1]]++
      |                            ^
      |                            ;
   15 |         }
      |         ~
Language: C++

#include<stdio.h>
#define MAX 2000000
#define VMAX 10000
int C[VMAX + 1];
int n;

void CountingSort(int A[], int B[], int k){
	int i;
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (i = 0; i < n; i++){
		C[A[i + 1]]++;
	}
	for (i = 0; i < k; i++){
		C[i] += C[i + 1];
	}
	for (i = 1; i <= n; i++){
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int main(){
	unsigned short *A, *B;
	scanf("%d", &n);
	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);
	for (int i = 0; i < n; i++){
		scanf("%hu", &A[i+1]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'malloc' was not declared in this scope
   27 |         A = malloc(sizeof(short)*n + 1);
      |             ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 | #define MAX 2000000
a.cc:32:22: error: cannot convert 'short unsigned int*' to 'int*'
   32 |         CountingSort(A, B, VMAX+1);
      |                      ^
      |                      |
      |                      short unsigned int*
a.cc:7:23: note:   initializing argument 1 of 'void CountingSort(int*, int*, int)'
    7 | void CountingSort(int A[], int B[], int k){
      |                   ~~~~^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000
int C[VMAX + 1];
int n;

void CountingSort(int A[], int B[], int k){
	int i;
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (i = 0; i < n; i++){
		C[A[i + 1]]++;
	}
	for (i = 0; i < k; i++){
		C[i] += C[i + 1];
	}
	for (i = 1; i <= n; i++){
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int main(){
	unsigned short *A, *B;
	scanf("%d", &n);
	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);
	for (int i = 0; i < n; i++){
		scanf("%hu", &A[i+1]);
	}
	CountingSort(A, B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   28 |         A = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:29:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |         B = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:33:22: error: cannot convert 'short unsigned int*' to 'int*'
   33 |         CountingSort(A, B, VMAX+1);
      |                      ^
      |                      |
      |                      short unsigned int*
a.cc:8:23: note:   initializing argument 1 of 'void CountingSort(int*, int*, int)'
    8 | void CountingSort(int A[], int B[], int k){
      |                   ~~~~^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000
int C[VMAX + 1];
int n;

void CountingSort(unsigned short *A,unsigned short *B, int k){
	int i;
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (i = 0; i < n; i++){
		C[A[i + 1]]++;
	}
	for (i = 0; i < k; i++){
		C[i] += C[i + 1];
	}
	for (i = 1; i <= n; i++){
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int main(){
	unsigned short *A, *B;
	scanf("%d", &n);
	A = malloc(sizeof(short)*n + 1);
	B = malloc(sizeof(short)*n + 1);
	for (int i = 0; i < n; i++){
		scanf("%hu", &A[i+1]);
	}
	CountingSort(*A, *B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   28 |         A = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:29:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |         B = malloc(sizeof(short)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:33:22: error: invalid conversion from 'short unsigned int' to 'short unsigned int*' [-fpermissive]
   33 |         CountingSort(*A, *B, VMAX+1);
      |                      ^~
      |                      |
      |                      short unsigned int
a.cc:8:35: note:   initializing argument 1 of 'void CountingSort(short unsigned int*, short unsigned int*, int)'
    8 | void CountingSort(unsigned short *A,unsigned short *B, int k){
      |                   ~~~~~~~~~~~~~~~~^
a.cc:33:26: error: invalid conversion from 'short unsigned int' to 'short unsigned int*' [-fpermissive]
   33 |         CountingSort(*A, *B, VMAX+1);
      |                          ^~
      |                          |
      |                          short unsigned int
a.cc:8:53: note:   initializing argument 2 of 'void CountingSort(short unsigned int*, short unsigned int*, int)'
    8 | void CountingSort(unsigned short *A,unsigned short *B, int k){
      |                                     ~~~~~~~~~~~~~~~~^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000
int C[VMAX + 1];
int n;

void CountingSort(unsigned short *A,unsigned short *B, int k){
	int i;
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (i = 0; i < n; i++){
		C[A[i + 1]]++;
	}
	for (i = 0; i < k; i++){
		C[i] += C[i + 1];
	}
	for (i = 1; i <= n; i++){
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int main(){
	unsigned short *A, *B;
	scanf("%d", &n);
	A = malloc(sizeof(short) * n + 1);
	B = malloc(sizeof(short) * n + 1);
	for (int i = 0; i < n; i++){
		scanf("%hu", &A[i+1]);
	}
	CountingSort(*A, *B, VMAX+1);
	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   28 |         A = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:29:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   29 |         B = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:33:22: error: invalid conversion from 'short unsigned int' to 'short unsigned int*' [-fpermissive]
   33 |         CountingSort(*A, *B, VMAX+1);
      |                      ^~
      |                      |
      |                      short unsigned int
a.cc:8:35: note:   initializing argument 1 of 'void CountingSort(short unsigned int*, short unsigned int*, int)'
    8 | void CountingSort(unsigned short *A,unsigned short *B, int k){
      |                   ~~~~~~~~~~~~~~~~^
a.cc:33:26: error: invalid conversion from 'short unsigned int' to 'short unsigned int*' [-fpermissive]
   33 |         CountingSort(*A, *B, VMAX+1);
      |                          ^~
      |                          |
      |                          short unsigned int
a.cc:8:53: note:   initializing argument 2 of 'void CountingSort(short unsigned int*, short unsigned int*, int)'
    8 | void CountingSort(unsigned short *A,unsigned short *B, int k){
      |                                     ~~~~~~~~~~~~~~~~^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000
int C[VMAX + 1];
int n;

int main(){
	unsigned short *A, *B;
	scanf("%d", &n);
	A = malloc(sizeof(short) * n + 1);
	B = malloc(sizeof(short) * n + 1);
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%hu", &A[i+1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


	for (int i = 0; i < n; i++){
		if (i)printf(" ");
		printf("%d", &B[i]);
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   11 |         A = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:12:19: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   12 |         B = malloc(sizeof(short) * n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         for (i = 0; i < k; k++){
      |              ^
a.cc:13:25: error: 'k' was not declared in this scope
   13 |         for (i = 0; i < k; k++){
      |                         ^
a.cc:21:14: error: 'i' was not declared in this scope
   21 |         for (i = 1; i <= VMAX; i++){
      |              ^
a.cc:25:14: error: 'i' was not declared in this scope
   25 |         for (i = 1; i <= n; i++){
      |              ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000

int main(){
	int C[VMAX + 1];
	int n;
	scanf("%d", &n);
	int A[n + 1];
	int B[n + 1];
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i+1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'i' was not declared in this scope
   12 |         for (i = 0; i < k; k++){
      |              ^
a.cc:12:25: error: 'k' was not declared in this scope
   12 |         for (i = 0; i < k; k++){
      |                         ^
a.cc:20:14: error: 'i' was not declared in this scope
   20 |         for (i = 1; i <= VMAX; i++){
      |              ^
a.cc:24:14: error: 'i' was not declared in this scope
   24 |         for (i = 1; i <= n; i++){
      |              ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000

int main(){
	int C[VMAX + 1];
	int n,i;
	scanf("%d", &n);
	int A[n + 1];
	int B[n + 1];
	for (i = 0; i < k; k++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i+1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'k' was not declared in this scope
   12 |         for (i = 0; i < k; k++){
      |                         ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000

int main(){
	int C[VMAX + 1];
	int n,i;
	scanf("%d", &n);
	int A[n + 1];
	int B[n + 1];
	for (i = 0; i <= VMAX ; k++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i+1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: 'k' was not declared in this scope
   12 |         for (i = 0; i <= VMAX ; k++){
      |                                 ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000

int main(){
	int *A.*B;
	int C[VMAX + 1];
	int n, i;
	scanf("%d", &n);
	A = malloc(sizeof(int)*n + 1);
	B = malloc(sizeof(int)*n + 1);
	for (i = 0; i <= VMAX; i++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i + 1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected initializer before '.*' token
    7 |         int *A.*B;
      |               ^~
a.cc:11:9: error: 'A' was not declared in this scope
   11 |         A = malloc(sizeof(int)*n + 1);
      |         ^
a.cc:12:9: error: 'B' was not declared in this scope
   12 |         B = malloc(sizeof(int)*n + 1);
      |         ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000000
#define VMAX 10000

int main(){
	int *A,*B;
	int C[VMAX + 1];
	int n, i;
	scanf("%d", &n);
	A = malloc(sizeof(int)*n + 1);
	B = malloc(sizeof(int)*n + 1);
	for (i = 0; i <= VMAX; i++){
		C[i] = 0;
	}
	for (int i = 0; i < n; i++){
		scanf("%d", &A[i + 1]);
		C[A[i + 1]]++;
	}

	for (i = 1; i <= VMAX; i++){
		C[i] += C[i + 1];
	}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   11 |         A = malloc(sizeof(int)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:12:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   12 |         B = malloc(sizeof(int)*n + 1);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   11 |         A=malloc(sizeof(short) * n+1);
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
a.cc:12:17: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   12 |         B=malloc(sizeof(short) * n+1);
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
Language: C++

#include <iostream>

using namespace std;
#define max = 2000001
#define vmax = 10000

int main(){
    unsigned short *A, *B;
    int c[vmax+1];
    int n,i,j;
    cin >> n;
    A = malloc(sizeof(short)*n+1);
    B = malloc(sizeof(short)*n+1);
    for (i = 0; i<vmax;i++){
        c[i]=0;
    }
    for (i = 0;i<n; i++){
        cin >> A[i];
        c[A[i]]++;
    }
    for (i = 1;i<=vmax;i++){
        c[i] = c[i -1] + c[i];
    }
    for (j = 0; j<=n;j++){
        B[c[A[j]]] = A[j];
        c[A[j]]--;
    }
    for (i = 1; i<=n ;i++){
        if (i>1) cout << " ";
        cout << B[i];
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected primary-expression before '=' token
    5 | #define vmax = 10000
      |              ^
a.cc:9:11: note: in expansion of macro 'vmax'
    9 |     int c[vmax+1];
      |           ^~~~
a.cc:12:15: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   12 |     A = malloc(sizeof(short)*n+1);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc:13:15: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   13 |     B = malloc(sizeof(short)*n+1);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc:5:14: error: expected primary-expression before '=' token
    5 | #define vmax = 10000
      |              ^
a.cc:14:19: note: in expansion of macro 'vmax'
   14 |     for (i = 0; i<vmax;i++){
      |                   ^~~~
a.cc:15:9: error: 'c' was not declared in this scope
   15 |         c[i]=0;
      |         ^
a.cc:19:9: error: 'c' was not declared in this scope
   19 |         c[A[i]]++;
      |         ^
a.cc:5:14: error: expected primary-expression before '=' token
    5 | #define vmax = 10000
      |              ^
a.cc:21:19: note: in expansion of macro 'vmax'
   21 |     for (i = 1;i<=vmax;i++){
      |                   ^~~~
a.cc:22:9: error: 'c' was not declared in this scope
   22 |         c[i] = c[i -1] + c[i];
      |         ^
a.cc:25:11: error: 'c' was not declared in this scope
   25 |         B[c[A[j]]] = A[j];
      |           ^