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

include <stdio.h>

#define MAX 2000001
#define VMAX 10000

void countingsort();
int A[MAX],B[MAX],C[VMAX+1];
int n,i,k=0;


int main(){

  scanf("%d",&n);

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

  countingsort(VMAX,n);

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


return 0;
}

void countingsort(int k,int n){
  int 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>0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
}



Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:13:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:13:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |   scanf("%d",&n);
      |   ^~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:19:3: error: implicit declaration of function 'countingsort' [-Wimplicit-function-declaration]
   19 |   countingsort(VMAX,n);
      |   ^~~~~~~~~~~~
main.c:22:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   22 |     printf("%d ",B[i]);
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   24 |   printf("%d",B[n]);
      |   ^~~~~~
main.c:24:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:31:6: warning: conflicting types for 'countingsort'; have 'void(int,  int)'
   31 | void countingsort(int k,int n){
      |      ^~~~~~~~~~~~
main.c:19:3: note: previous implicit declaration of 'countingsort' with type 'void(int,  int)'
   19 |   countingsort(VMAX,n);
      |   ^~~~~~~~~~~~
Language: C

#include  <stdio.h>

/*int n, C[10000];

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

}
*/

int main()
{

  int i, j, a, n;
  int C[10000];

  a = 0;
  
  scanf("%d",&n);
  int A[n], B[n];
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(a < A[i]){
      a = A[i];
    }
  }

  for(i=0;i<=k;i++){
    C[i] = 0;
  }
	    
  /* C[i] に i の出現数を記録する */
  for(j=0;j<n;j++){
    C[A[j]]++;
  }

  /* C[i] に i 以下の数の出現数を記録する*/
  for(i=0;i<=k;i++){
    C[i] = C[i] + C[i-1];
  }

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

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

  return 0;

}



Compiler output:
main.c: In function 'main':
main.c:32:14: error: 'k' undeclared (first use in this function)
   32 |   for(i=0;i<=k;i++){
      |              ^
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include  <stdio.h>

/*int n, C[10000];

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

}
*/

int main()
{

  int i, j, k, n;
  int C[10000];

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

  for(i=0;i<=k+1;i++){
    C[i] = 0;
  }
	    
  /* C[i] に i の出現数を記録する */
  for(j=0;j<n;j++){
    C[A[j]]++;
  }

  /* C[i] に i 以下の数の出現数を記録する*/
  for(i=0;i<=k+1;i++){
    C[i] = C[i] + C[i-1];
  }

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

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

  return 0;

}



Compiler output:
main.c: In function 'main':
main.c:21:3: error: 'a' undeclared (first use in this function)
   21 |   a = 0;
      |   ^
main.c:21:3: note: each undeclared identifier is reported only once for each function it appears in
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 = 0; i <= VMAX; 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:
main.c: In function 'main':
main.c:19:22: error: '$A' undeclared (first use in this function); did you mean 'A'?
   19 |         scanf("%hu", $A[i + 1]);
      |                      ^~
      |                      A
main.c:19:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#define M 2000001
#define VM 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<=VM;i++)C[i]=0;
  for(i=0;i<n;i++){
    scanf("hu"&A[i+1]);
    C[A[i+1]]++;
  }
  for(i=1;i<=VM;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");

}



Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'VMAX' undeclared (first use in this function); did you mean 'VM'?
    8 |   int C[VMAX+1];
      |         ^~~~
      |         VM
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:15: error: invalid operands to binary & (have 'char *' and 'int')
   17 |     scanf("hu"&A[i+1]);
      |           ~~~~^~~~~~~
      |           |     |
      |           |     short unsigned int
      |           char *
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=1j<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:
main.c: In function 'main':
main.c:27:11: error: invalid operands to binary < (have 'complex int' and 'int')
   27 |   for(j=1j<n;j++){
      |           ^
main.c:27:17: error: expected ';' before ')' token
   27 |   for(j=1j<n;j++){
      |                 ^
      |                 ;
main.c:29:6: error: expected ';' before '{' token
   29 |     C{A}[j]--;
      |      ^
      |      ;
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:
main.c: In function 'main':
main.c:29:6: error: expected ';' before '{' token
   29 |     C{A}[j]--;
      |      ^
      |      ;
Language: C

include <stdio.h>
#define MAX 20000
int main(){//kが要素の最大値                                                    
  int N,A[MAX],B[MAX],C[MAX],i,j,k=0;
  scanf("%d",&N);
  for(i=1;i<=N;i++){
    scanf("%d",&A[i]);
    if(A[i-1]>k)
      k=A[i-1];//最大値求めた                                                   
  }
  for(i=0;i<=k;i++)
    C[i]=0;//初期化                                                             

  for(j=1;j<=N;j++)
    C[A[j]]=C[A[j]]+1;//A[i]の出現数を記録する                                  

  for(i=1;i<=k;i++)
    C[i]=C[i]+C[i-1];//前の数を足していく                                       
  for(j=N;j>0;j--){
    B[C[A[j]]]=A[j];
    C[A[j]]=C[A[j]]-1;
  }
  for(i=1;i<=N;i++){
    printf("%d",B[i]);
    if(i==N){
      printf("\n");
      break;
    }
    printf(" ");
  }
  return 0;
}



Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include<stdio.h>
#define MAX 2000001
#define  VMAX   10000
void countingsort(int*, int);

int a[MAX - 1];
int count[VMAX + 1];
int main(void) {
	int i, n;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}

}
void countingsort(int a[], int b[] ,int n){
	int  i, n, b[MAX-1];
	
	for (i = 0; i <= VMAX; i++) {
		count[i] = 0;
	}

	for (i = 0; i < n; i++) {
		count[a[i]]++;
	}

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

	for (i = n ; i > 0; i--) {
		b[count[a[i]]] = a[i];
		count[a[i]]--;
	}
	for (i = 0; i < n-1; i++) {
		printf("%d ",a[i]);
	}
	printf("%d\n", a[n - 1]);
}


Compiler output:
main.c:16:6: error: conflicting types for 'countingsort'; have 'void(int *, int *, int)'
   16 | void countingsort(int a[], int b[] ,int n){
      |      ^~~~~~~~~~~~
main.c:4:6: note: previous declaration of 'countingsort' with type 'void(int *, int)'
    4 | void countingsort(int*, int);
      |      ^~~~~~~~~~~~
main.c: In function 'countingsort':
main.c:17:17: error: 'n' redeclared as different kind of symbol
   17 |         int  i, n, b[MAX-1];
      |                 ^
main.c:16:41: note: previous definition of 'n' with type 'int'
   16 | void countingsort(int a[], int b[] ,int n){
      |                                     ~~~~^
main.c:17:20: error: 'b' redeclared as different kind of symbol
   17 |         int  i, n, b[MAX-1];
      |                    ^
main.c:16:32: note: previous definition of 'b' with type 'int *'
   16 | void countingsort(int a[], int b[] ,int n){
      |                            ~~~~^~~
Language: C

#include<stdio.h>
#define MAX 2000001
#define  VMAX   10000
void countingsort(int*, int,int);

int a[MAX - 1];
int count[VMAX + 1];
int main(void) {
	int i, n;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	countingsort(a, 0, n);
	return 0;
}
void countingsort(int a[], int b[] ,int n){
	int  i, n, b[MAX-1];
	
	for (i = 0; i <= VMAX; i++) {
		count[i] = 0;
	}

	for (i = 0; i < n; i++) {
		count[a[i]]++;
	}

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

	for (i = n ; i > 0; i--) {
		b[count[a[i]]] = a[i];
		count[a[i]]--;
	}
	for (i = 0; i < n-1; i++) {
		printf("%d ",a[i]);
	}
	printf("%d\n", a[n - 1]);
}


Compiler output:
main.c:17:6: error: conflicting types for 'countingsort'; have 'void(int *, int *, int)'
   17 | void countingsort(int a[], int b[] ,int n){
      |      ^~~~~~~~~~~~
main.c:4:6: note: previous declaration of 'countingsort' with type 'void(int *, int,  int)'
    4 | void countingsort(int*, int,int);
      |      ^~~~~~~~~~~~
main.c: In function 'countingsort':
main.c:18:17: error: 'n' redeclared as different kind of symbol
   18 |         int  i, n, b[MAX-1];
      |                 ^
main.c:17:41: note: previous definition of 'n' with type 'int'
   17 | void countingsort(int a[], int b[] ,int n){
      |                                     ~~~~^
main.c:18:20: error: 'b' redeclared as different kind of symbol
   18 |         int  i, n, b[MAX-1];
      |                    ^
main.c:17:32: note: previous definition of 'b' with type 'int *'
   17 | void countingsort(int a[], int b[] ,int n){
      |                            ~~~~^~~
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 < 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;i <=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:
main.c: In function 'main':
main.c:22:12: error: 'c' undeclared (first use in this function)
   22 |     C[i] = c[i] + C[i -1];
      |            ^
main.c:22:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int C[VMAX+1];
int n;

void CountingSort(;

int main(){
  unsigned int *A, *B;
  int i,j,k=0;
  scanf("%d", &n);
  for(i=1;i<=n;i++){
    scanf("%d",A);
  }

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

  CountingSort(VMAX,n);

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

  return 0;
}

void CountingSort(int k,int n){

  int i,j;

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

/* C[i] �� i �̏o�������L�^���� */
for( j = 1; j < n; j++){
  C[A[j]]++;
 }

/* C[i] �� i �ȉ��̐��̏o�������L�^����*/
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]]--;
 }
}


Compiler output:
main.c:9:19: error: expected declaration specifiers or '...' before ';' token
    9 | void CountingSort(;
      |                   ^
main.c:11:11: error: expected ';', ',' or ')' before '{' token
   11 | int main(){
      |           ^
Language: C

#include <stadio.h>
#include <stdlib.h>
#define M 2000001
#define VM 10000

int main(){

  unsigned short *a,*b;
  int d[VM+1];
  int n,i,j;

  scanf("%d",&n);

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

  for(i=0;i<=VM;i++)d[i]=0;

  for(j=0;j<n;j++){
    scanf("%u",&a[j+1]);
    d[a[j+1]]++;

  }
  for(i=1;i<=VM;i++)d[i]=d[i]+d[i-1];

  for(j=n;j>=1;j--){
    b[d[a[j]]]=a[j];
    d[a[j]]--;
  }

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



  return 0;
}



Compiler output:
main.c:1:10: fatal error: stadio.h: No such file or directory
    1 | #include <stadio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

#define MAX 2000001
#define VMAX 10001

int main() {
  int n, i, j, a[MAX], c[MAX], x[MAX];

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

  scanf("%d", &n);

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

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

  for(j = 0; j < n; j++){
    x[c[a[j]]] = a[j];
    c[a[j]]--;
  }

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

  printf("\n");

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:15:8: error: 'max' undeclared (first use in this function)
   15 |     if(max < a[i]) max = a[i];
      |        ^~~
main.c:15:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include  <stdio.h>


int main()
{

  int i, j, n;
  int C[100000];

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

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

  for(i=1;i<=10000;i++){
    C[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:
main.c: In function 'main':
main.c:10:3: error: 'k' undeclared (first use in this function)
   10 |   k = 0;
      |   ^
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int C[VMAX+1],n;

void CountingSort(short *,short *,int);

int main(){
unsigned short *A, *B;
int i,j,k=0;
	
  scanf("%d", &n);

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

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

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

printf("\n");
free(A);
free(B);

return 0;
}
void CountingSort(short A[],short B[],int k){
int i,j;

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

/* C[i] �� i �̏o�������L�^���� */
  C[A[j+1]]++;
 }

/* C[i] �� i �ȉ��̐��̏o�������L�^����*/
for( i = 1; i<=k; i++){
  C[i] = C[i] + C[i-1];
 }

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




Compiler output:
main.c:49:1: error: expected identifier or '(' before 'for'
   49 | for( i = 1; i<=k; i++){
      | ^~~
main.c:49:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   49 | for( i = 1; i<=k; i++){
      |              ^~
main.c:49:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   49 | for( i = 1; i<=k; i++){
      |                    ^~
main.c:53:1: error: expected identifier or '(' before 'for'
   53 | for (j = n; j > 0; j--){
      | ^~~
main.c:53:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
   53 | for (j = n; j > 0; j--){
      |               ^
main.c:53:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   53 | for (j = n; j > 0; j--){
      |                     ^~
main.c:57:1: error: expected identifier or '(' before '}' token
   57 | }
      | ^
Language: C

	#include<stdio.h>

	int A[100000];

	int partition(int A[],int p,int r){
	int x = A[r-1];
	int i = p,j;
	for(j = p; j<r-1;j++){
	if(A[j] <= x){
	int temp = A[i];
	A[i] = A[j];
	A[j] = temp;
	i++;
	}
	}
	int temp = A[i];
	A[i] = A[r-1];
	A[r-1] = temp;
	 return i;
	}

	int main(){
	  int n,i;
	scanf("%d",n);
	for(i=0;i<n;i++){
	scanf("%d",&A[i]);
	}
	int ip = partition(A,0,n);
	for(i=0; i<n; i++){
	if(i == ip){
	 printf("[%d]",A[i]);
	} else printf("%d",A[i]);
	putchar(i < n -1? ' ' : '\n');
	}
	}

}


	




Compiler output:
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | }
      | ^
Language: C

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

void CountingSort(unsigned short X[],unsigned short Y[]);

int C[VMAX + 1];
int n;

int main(){
  unsigned short *X,*Y;
  int i;

  scanf("%d",&n);

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

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

  CountingSort(X,Y);

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

  free(A);
  free(B);

  return 0;
}

void CountingSort(unsigned short X[],unsigned short Y[]){
  int i,j;
  
  for(i = 0;i <= VMAX;i++){     
    C[i] = 0;
  }
  for(j = 1;j <= n;j++){                     /*C[i]にiの出現数を記録する*/
    C[X[j]]++;
  }
  for(i = 1;i <= VMAX;i++){      /*i以下の数の出現数を記録する*/
    C[i] = C[i] + C[i-1];
  }
  for(j = 1;j <= n;j++){
    Y[C[X[j]]] = X[j];
    C[X[j]]--;
  }

}



Compiler output:
main.c: In function 'main':
main.c:17:3: error: 'A' undeclared (first use in this function)
   17 |   A = malloc(sizeof(short) * n + 1);
      |   ^
main.c:17:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:3: error: 'B' undeclared (first use in this function)
   18 |   B = malloc(sizeof(short) * n + 1);
      |   ^
Language: C

#include<stdio.h>
#define N 200000
#define K 10000

int main(){
  int n,i;
  int A[N],B[N],C[K];

  scanf("%d",&n);


  for( i=0 ; i<K ; i++){
    C[i]=0;
  }

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

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

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

  printf("\n");

  return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:25:16: error: '\U0000ff1dn' undeclared (first use in this function)
   25 |   for( i=0 ; i<＝n ; i++ ){
      |                ^~~
main.c:25:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int main(){
  int n,i,j;

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

void CountingSort(int k,int n){
  int i;

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

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

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


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

}

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:34: error: 'A' undeclared (first use in this function)
    5 |   for(i=1;i<n+1;i++) scanf("%d",&A[i]);
      |                                  ^
main.c:5:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:5: error: implicit declaration of function 'CountingSort' [-Wimplicit-function-declaration]
    6 |     CountingSort(K,n);
      |     ^~~~~~~~~~~~
main.c:6:18: error: 'K' undeclared (first use in this function)
    6 |     CountingSort(K,n);
      |                  ^
main.c:8:23: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |      for(i=1;i<n;i++) printf("%d ",B[i]);
      |                       ^~~~~~
main.c:8:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:23: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:36: error: 'B' undeclared (first use in this function)
    8 |      for(i=1;i<n;i++) printf("%d ",B[i]);
      |                                    ^
main.c:9:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    9 |   printf("%d\n",B[i]);
      |   ^~~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:14:6: warning: conflicting types for 'CountingSort'; have 'void(int,  int)'
   14 | void CountingSort(int k,int n){
      |      ^~~~~~~~~~~~
main.c:6:5: note: previous implicit declaration of 'CountingSort' with type 'void(int,  int)'
    6 |     CountingSort(K,n);
      |     ^~~~~~~~~~~~
main.c: In function 'CountingSort':
main.c:17:20: error: 'C' undeclared (first use in this function)
   17 |   for(i=0;i<k;i++) C[i]=0;
      |                    ^
main.c:19:25: error: 'A' undeclared (first use in this function)
   19 |    for(i=1;i<n+1;i++) C[A[i]]++;
      |                         ^
main.c:25:5: error: 'B' undeclared (first use in this function)
   25 |     B[C[A[i]]] = A[i];
      |     ^
Language: C



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

#define K 10000

void CountingSort(int, int*, int*);

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

  scanf("%d", &n);

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

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

  CountingSort(n, A, B);

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

  return 0;
}

void CountingSort(int n){
  int i, j;
  int C[K];

  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]]--;
  }

}

Compiler output:
main.c:33:6: error: conflicting types for 'CountingSort'; have 'void(int)'
   33 | void CountingSort(int n){
      |      ^~~~~~~~~~~~
main.c:8:6: note: previous declaration of 'CountingSort' with type 'void(int,  int *, int *)'
    8 | void CountingSort(int, int*, int*);
      |      ^~~~~~~~~~~~
main.c: In function 'CountingSort':
main.c:42:7: error: 'A' undeclared (first use in this function)
   42 |     C[A[j]]++;
      |       ^
main.c:42:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:50:5: error: 'B' undeclared (first use in this function)
   50 |     B[C[A[j]]] = A[j];
      |     ^
Language: C

#include <stdio.h>

#define MAX 200001
#define MAXV 10001

int A[MAX];
int B[MAX];

int main(){
  int i, n;
  int C[MAXV];

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

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

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

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

  printf("\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:19: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
   23 |   for(i = 1; i <= VMAX; i++)
      |                   ^~~~
      |                   MAX
main.c:23:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   34 |     prinf("%d", B[i]);
      |     ^~~~~
      |     printf
Language: C

#include <stdio.h>

#define MAX 200001
#define MAXV 10001

int A[MAX];
int B[MAX];

int main(){
  int i, n;
  int C[MAXV];

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

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

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

  for(i = 1; i <= MAXV; 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(" ");
    prinf("%d", B[i]);
  }

  printf("\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   34 |     prinf("%d", B[i]);
      |     ^~~~~
      |     printf
Language: C

    C[A[i]]++;

  for(i = 1; i <= MAXV; 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(" ");
    printf("%d", B[i]);
  }

  printf("\n");

  return 0;
}

Compiler output:
main.c:1:7: error: 'A' undeclared here (not in a function)
    1 |     C[A[i]]++;
      |       ^
main.c:1:9: error: 'i' undeclared here (not in a function)
    1 |     C[A[i]]++;
      |         ^
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 |     C[A[i]]++;
      |            ^~
main.c:3:3: error: expected identifier or '(' before 'for'
    3 |   for(i = 1; i <= MAXV; i++)
      |   ^~~
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    3 |   for(i = 1; i <= MAXV; i++)
      |                ^~
main.c:3:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |   for(i = 1; i <= MAXV; i++)
      |                          ^~
main.c:6:3: error: expected identifier or '(' before 'for'
    6 |   for(i = 1; i <= n; i++){
      |   ^~~
main.c:6:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    6 |   for(i = 1; i <= n; i++){
      |                ^~
main.c:6:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    6 |   for(i = 1; i <= n; i++){
      |                       ^~
main.c:11:3: error: expected identifier or '(' before 'for'
   11 |   for(i = 1; i <= n; i++){
      |   ^~~
main.c:11:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   11 |   for(i = 1; i <= n; i++){
      |                ^~
main.c:11:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 |   for(i = 1; i <= n; i++){
      |                       ^~
main.c:17:10: error: expected declaration specifiers or '...' before string constant
   17 |   printf("\n");
      |          ^~~~
main.c:19:3: error: expected identifier or '(' before 'return'
   19 |   return 0;
      |   ^~~~~~
main.c:20:1: error: expected identifier or '(' before '}' token
   20 | }
      | ^
Language: C

#include<stdio.h>
#define N １0000
int b[N],c[N],d[N];

main(){
  int i,j,a;
  scanf("%d",&a);
 for(i=0;i<=N;i++){
    c[i]=0;
  }
  for(j=0;j<a;j++){
    scanf("%d",&b[j+1]);
    c[b[j+1]]++;
  }
 
  for(i=1;i<=N;i++){
    c[i]=c[i]+c[i-1];
  }
  for(j=a;j>=1;j--){
    d[c[b[j]]]=b[j];
    c[b[j]]--;
  }
  
  for(i=1;i<a;i++){
    printf("%d ",d[i]);
  }
  printf("%d\n",d[a]);
  return 0;
  }
  

Compiler output:
main.c:2:11: error: '\U0000ff110000' undeclared here (not in a function)
    2 | #define N １0000
      |           ^~~~~~
main.c:3:7: note: in expansion of macro 'N'
    3 | int b[N],c[N],d[N];
      |       ^
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
Language: C

#include <stdio.h>
#define N 20000001

int B[N], C[N], A[N], n;

void CountingSort(int k)
{
  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 > 0;j--)
    {
      B[C[A[j]]] = A[j];
      C[A[j]]--;
    }
}

main()
{

  int i, max = 0;

  scanf("%d",&n);

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

  CountigSort(max);

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

     

Compiler output:
main.c: In function 'CountingSort':
main.c:11:7: error: 'c' undeclared (first use in this function)
   11 |       c[i] = 0;
      |       ^
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:28:1: error: return type defaults to 'int' [-Wimplicit-int]
   28 | main()
      | ^~~~
main.c: In function 'main':
main.c:44:3: error: implicit declaration of function 'CountigSort'; did you mean 'CountingSort'? [-Wimplicit-function-declaration]
   44 |   CountigSort(max);
      |   ^~~~~~~~~~~
      |   CountingSort
Language: C

#include<stdio.h>
 
void counting_sort(int);
int A[2000000], B[2000000],C[2000000];
int n;
 
main(){
  
  int max=0;
  int i,j;
   
  scanf("%d",&n);
  for(i=1; i <= n; i++){
    scanf("%d",&C[i]);
    if(max <= C[i])
      max = C[i];
  }
   
  counting_sort(max);
   
  for(i=1; i<=n; i++){
    printf("%d",C[i]);
    if((i>0) && (i<n))
      printf(" ");
  }
  printf("\n");
   
  return 0;
}

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

Compiler output:
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
    7 | main(){
      | ^~~~
main.c: In function 'counting_sort':
main.c:35:3: error: expected declaration specifiers before 'for'
   35 |   for(i=0; i <= k; i++){
      |   ^~~
main.c:35:12: error: expected declaration specifiers before 'i'
   35 |   for(i=0; i <= k; i++){
      |            ^
main.c:35:20: error: expected declaration specifiers before 'i'
   35 |   for(i=0; i <= k; i++){
      |                    ^
main.c:38:3: error: expected declaration specifiers before 'for'
   38 |   for(j=1; j <= n; j++){
      |   ^~~
main.c:38:12: error: expected declaration specifiers before 'j'
   38 |   for(j=1; j <= n; j++){
      |            ^
main.c:38:20: error: expected declaration specifiers before 'j'
   38 |   for(j=1; j <= n; j++){
      |                    ^
main.c:41:3: error: expected declaration specifiers before 'for'
   41 |   for(i=1; i <= k; i++){
      |   ^~~
main.c:41:12: error: expected declaration specifiers before 'i'
   41 |   for(i=1; i <= k; i++){
      |            ^
main.c:41:20: error: expected declaration specifiers before 'i'
   41 |   for(i=1; i <= k; i++){
      |                    ^
main.c:44:3: error: expected declaration specifiers before 'for'
   44 |   for(j=n; j >= 1; j--){
      |   ^~~
main.c:44:12: error: expected declaration specifiers before 'j'
   44 |   for(j=n; j >= 1; j--){
      |            ^
main.c:44:20: error: expected declaration specifiers before 'j'
   44 |   for(j=n; j >= 1; j--){
      |                    ^
main.c:48:1: error: expected declaration specifiers before '}' token
   48 | }
      | ^
main.c:32:6: error: old-style parameter declarations in prototyped function definition
   32 | void counting_sort(int k)
      |      ^~~~~~~~~~~~~
main.c:49: error: expected '{' at end of input
Language: C

#include <stdio.h>
#define N 2000000
  
int A[N],B[N],C[N];
 
main()
{
 
   
  int i,z,j,n=0;
   
   
  scanf("%d",&n)
   
  for(i = 0; i <z ; i++){
    scanf("%d",&A[i]);
   C[A[i]]++;
    
   if(0 < A[i]){
      n = A[i];
   }
  }
  for(i = 1; i <= n; i++){
    C[i] = C[i] + C[i-1];
  }
  for(j = z-1; j >= 0; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
 
  for(i = 1; i <= z; i++){
    if(i!=z){
      printf("%d ",B[i]);
    }
    else {
       
      printf("%d\n",B[i]);
    }
  }
  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main()
      | ^~~~
main.c: In function 'main':
main.c:13:17: error: expected ';' before 'for'
   13 |   scanf("%d",&n)
      |                 ^
      |                 ;
   14 | 
   15 |   for(i = 0; i <z ; i++){
      |   ~~~
Language: C

#include <stdio.h>
#define N 2000000
  
int A[N],B[N],C[N];
 
main()
{
 
   
  int i,z,j,n=0;
   
   
  scanf("%d",&n)
   
  for(i = 0; i <z ; i++){
    scanf("%d",&A[i]);
   C[A[i]]++;
    
   if(0 < A[i]){
      k = A[i];
   }
  }
  for(i = 1; i <= n; i++){
    C[i] = C[i] + C[i-1];
  }
  for(j = z-1; j >= 0; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
 
  for(i = 1; i <= z; i++){
    if(i!=z){
      printf("%d ",B[i]);
    }
    else {
       
      printf("%d\n",B[i]);
    }
  }
  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main()
      | ^~~~
main.c: In function 'main':
main.c:13:17: error: expected ';' before 'for'
   13 |   scanf("%d",&n)
      |                 ^
      |                 ;
   14 | 
   15 |   for(i = 0; i <z ; i++){
      |   ~~~
Language: C

#include<stdio.h>
#define N 2000000

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

  scanf("%d",&n);

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

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


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

  return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:15: error: 'n' undeclared (first use in this function)
    8 |   scanf("%d",&n);
      |               ^
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int A[200001],C[200001];
main(){
  int i,n,B[10001];

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

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

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

}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:14: error: expected ';' before 'return'
   27 | printf("?\n")
      |              ^
      |              ;
   28 |  return 0;
      |  ~~~~~~
Language: C

"""Counting Sort."""

def countingSort(A, B):
    """Sort the elements of list A with Counting Sort algorithm.

    n is the length of A.
    The elements of A are intergers between 0 and k, inclusive.
    B is the output list where the sorted elements will be arranged.
    
    Print the elements of B in a line separated by a space character.
    """

    C = [0 for i in range(10001)]

    for i in A:
        C[i] += 1

    for i in range(1, 10001):
        C[i] = C[i] + C[i - 1]
    
    for i in A[::-1]:
        B[C[i]] = i
        C[i] -= 1

    print(*B[1:])


n = int(input())

A = list(map(int, input().split()))

B = [0 for i in range(n + 1)]

# k = max(A)

countingSort(A, B)

Compiler output:
main.c:1:1: error: expected identifier or '(' before string constant
    1 | """Counting Sort."""
      | ^~
main.c:4:7: warning: missing terminating " character
    4 |     """Sort the elements of list A with Counting Sort algorithm.
      |       ^
main.c:4:7: error: missing terminating " character
    4 |     """Sort the elements of list A with Counting Sort algorithm.
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:11:7: warning: missing terminating " character
   11 |     """
      |       ^
main.c:11:7: error: missing terminating " character
main.c:34:3: error: invalid preprocessing directive #k
   34 | # k = max(A)
      |   ^
Language: C

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

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

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

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

  for ( i = 0; i <= K; i++ ){
    C[i] = 0;
  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
    9 |   int C[VMAX+1];
      |         ^~~~
      |         MAX
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

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

  for(i=0; i<=V; i++){
    C[i]=0;
  }
  
  for(j=1; j<=n; j++){
    scanf("%d", &A[j]);
    C[A[j]]++;
  }
  
  for(i=1; i<=V; 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");
  
  free(A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:26: error: 'VMAX' undeclared (first use in this function)
    6 |   int i, j, n, *A, *B, C[VMAX+1];
      |                          ^~~~
main.c:6:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include<stdlib.h>
#define  M 2000000
#define  N 10000

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

void CountingSort(int A[], int B[], int k){
  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-1];
    }

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

Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'n' undeclared (first use in this function)
    9 |   scanf("%d",&n);
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:17: error: 'A' undeclared (first use in this function)
   11 |     scanf("%d",&A[i]);
      |                 ^
main.c:13:3: error: implicit declaration of function 'CountingSort' [-Wimplicit-function-declaration]
   13 |   CountingSort(A,0,N);
      |   ^~~~~~~~~~~~
main.c: At top level:
main.c:21:6: warning: conflicting types for 'CountingSort'; have 'void(int *, int *, int)'
   21 | void CountingSort(int A[], int B[], int k){
      |      ^~~~~~~~~~~~
main.c:13:3: note: previous implicit declaration of 'CountingSort' with type 'void(int *, int *, int)'
   13 |   CountingSort(A,0,N);
      |   ^~~~~~~~~~~~
main.c: In function 'CountingSort':
main.c:25:9: error: 'C' undeclared (first use in this function)
   25 |         C[i] = 0;
      |         ^
main.c:28:22: error: 'n' undeclared (first use in this function)
   28 |     for (j = 1; j <= n; j++){
      |                      ^
Language: C

#include<stdio.h>

void countingSort(int);

int A[2000000],B[2000000],C[10000],n=0;

int main(){

	int i,j,t;

	scanf("%d",&n);

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

		if(t<A[i])t=A[i];

	}

	countingSort(t);

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

		return 0;
	}

	void countingSort(int k){

		int i,j;

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

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

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

		}

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

Compiler output:
main.c:50:17: error: expected identifier or '(' before 'for'
   50 |                 for(j=n-1 ; j>=0 ; j--){
      |                 ^~~
main.c:50:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   50 |                 for(j=n-1 ; j>=0 ; j--){
      |                              ^~
main.c:50:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   50 |                 for(j=n-1 ; j>=0 ; j--){
      |                                     ^~
main.c:54:1: error: expected identifier or '(' before '}' token
   54 | }
      | ^
Language: C

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

#define MAX 2000001
#define VMAX 10000

int main(){
  unsigned short *A,*B;
  int i,n;
  int C[VMAX+1];

  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(i = 1;i <= n;i++){
    B[C[A[i]]] = A[i];
    C[A[j]]--;
  }

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:9: error: 'j' undeclared (first use in this function)
   31 |     C[A[j]]--;
      |         ^
main.c:31:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int A[MAX],B[MAX],C[VMAX+1];

int main()
{
 
  int k,i,j,n=0;

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

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

Compiler output:
main.c: In function 'main':
main.c:23:18: error: 'max' undeclared (first use in this function)
   23 |   for(i = 1;i <= max;i++)C[i] = C[i]+C[i-1];
      |                  ^~~
main.c:23:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int A[MAX],B[MAX],C[VMAX+1];

int main()
{
 
  int k,i;

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

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

Compiler output:
main.c: In function 'main':
main.c:27:9: error: 'n' undeclared (first use in this function)
   27 |   for(i=n;i>0;i--)
      |         ^
main.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAX 20000001
int A[MAX],B[MAX],C[MAX];

int main(){

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

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

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

  printf("%d\n",B[i]);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:13: error: 'k' undeclared (first use in this function)
   18 |   for(i=1;i<k;i++)
      |             ^
main.c:18:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdliub>

#define MAX 10000

void CountingSort(int *, int *, int);

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

  scanf("%d", &n);

  A = malloc(sizeof(int)*(n + 1));
  B = malloc(sizeof(int)*(n + 1));
  
  for( i = 1 ; i <= n ; i++ )
    scanf("%d", &A[i]);
  
  CountingSort(A, B, n);

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

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

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

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

Compiler output:
main.c:2:10: fatal error: stdliub: No such file or directory
    2 | #include <stdliub>
      |          ^~~~~~~~~
compilation terminated.
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++){
    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:
main.c: In function 'main':
main.c:28:20: error: expected ';' before 'i'
   28 |   for(i = 1; i <= n i++){
      |                    ^~
      |                    ;
Language: C

#include<bits/stdc++.h>

using namespace std;
int arr[2000000];

int main()
{
    int n,i;

    scanf("%d",&n);

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

    sort(arr,arr+n);

    for(i=0;i<n-1;i++)
    {
        printf("%d ",arr[i]);
    }
    printf("%d",arr[n-1]);

    return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long int n;
    while(cin>>n){
            int arr[n+5];
        for(int i=0;i<n;++i) cin>>arr[i];
        sort(arr,arr+n);
        cout<<arr[0];
        for(int i=1;i<n;++i)cout<<" "<<arr[i];
        cout<<endl;
    }
    return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.