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

#include <iostream>
#include <cstdlib>
#define MAX 2000001
#define VMAX 10000
using namespace std;

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



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

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

void counting_sort(int a[], int b[], int n)
{
    int  i;

    /* カウンタ(キーの出現回数)を初期化 */
    for (i = 0; i <= M; i++)
        count[i] = 0;

    /* キーの出現回数 */
    for (i = 0; i < n; i++)
        count[a[i]]++;

    /* 数え上げたキーの累積度数分布 */
    for (i = 0; i < M; i++) {
        count[i+1] += count[i];
    }

    /* 度数分布に従ってデータを配列aから配列bにコピーする */
    for (i = n - 1; i >= 0; i--) {
        b[--count[a[i]]] = a[i];
    }
}

int main(){
  int *a,*b;

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

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

  counting_sort(a,b,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 'counting_sort':
main.c:10:22: error: 'M' undeclared (first use in this function)
   10 |     for (i = 0; i <= M; i++)
      |                      ^
main.c:10:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:9: error: 'count' undeclared (first use in this function)
   11 |         count[i] = 0;
      |         ^~~~~
Language: C

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

int cnt[Max];

void counting_sort(int a[], int b[], int n)
{
    int  i;

    for (i = 0; i <= Max; i++)
        cnt[i] = 0;

    for (i = 0; i < n; i++)
        cnt[a[i]]++;

    for (i = 0; i < Max; i++) {
        cnt[i+1] += count[i];
    }

    for (i = n - 1; i >= 0; i--) {
        b[--cnt[a[i]]] = a[i];
    }
}


int main(){
  int *a,*b;

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

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

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



Compiler output:
main.c: In function 'counting_sort':
main.c:18:21: error: 'count' undeclared (first use in this function); did you mean 'cnt'?
   18 |         cnt[i+1] += count[i];
      |                     ^~~~~
      |                     cnt
main.c:18:21: 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(j=1;j<n+1;j++){
    scanf("%hu",&A[j]);
    C[A[j]]++;
  }
  for(i=1;i<=VMAX;i++){
    C[i]+=C[i-1];
  }
  for(i=n;i>0;i--){
    B[C[A[i]]]=A[i];
    C[A[i]]--;
  }
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d\n",B[i]);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:8:16: error: expected ';' before 'int'
    8 |   int C[VMAX+1]
      |                ^
      |                ;
    9 |   int n,i,j;
      |   ~~~           
main.c:14:5: error: 'C' undeclared (first use in this function)
   14 |     C[i]=0;
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <iostream>
#include <stdio.h>
void cs(int k);

int A[2000001];
int B[2000001];
int n;

// length is n
main(){

  int i,k=0;
  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
    if(A[i]>k) k=A[i];
  }
  // setting is finished

  cs(k);

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

  return 0;
}

void cs(int k){
  int C[k+1];
  int i,j,len;
  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]] = C[A[j]]-1;

  }

}

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

include <stdio.h>

int main(void){ 
  int A[10],i,k=0,j,n,C[10000],B[10];
  
  scanf("%d",&n);
  for(j = 1 ; j <= n ; j++){
    scanf("%d",&A[j]);
  }
  for(j = 1 ; j <= n ; j++){
    if(A[j] > k){   
      k = A[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 >= 1 ; j--){
    B[C[A[j]]] = A[j];
    C[A[j]] = C[A[j]] - 1;
  }
  for(j = 1 ; j <= n ; j++){
    printf("%d",B[j]);
    if(j < n-1){
      printf(" ");
    }
  }
  printf("\n");
  
  return 0;
}

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

#include<stdio.h>

int main(void){
  int A[100000];
  int C[100000];
  int B[100000];
  int i,j,k,n;
  k=0;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(A[i]>k)k=A[i];
    if(A[i]>2000000){
      printf("error"\n);
    }
  }
  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;
  }

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:21: error: stray '\' in program
   15 |       printf("error"\n);
      |                     ^
main.c:15:21: error: expected ')' before 'n'
   15 |       printf("error"\n);
      |             ~       ^~
      |                     )
Language: C

#include<iostream>
using namespace std;

int bukket[10001];

int main(){
	ios_base::sync_with_stdio(false);

	int num;
	cin >> num;
	while(cin >> num){
		bukket[num] ++;
	}

	for(int i = 0; i < 10001; i++){
		while(bukket[i] > 0){
			cout << i << "  ";
			bukket[i] --;
		}
	}

	return 0;
}

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

#include<iostream>
using namespace std;

int bukket[10001];

int main(){
	ios_base::sync_with_stdio(false);

	int num;
	cin >> num;
	while(cin >> num){
		bukket[num] ++;
	}

	for(int i = 0; i < 10001; i++){
		while(bukket[i] > 0){
			cout << i << "  ";
			bukket[i] --;
		}
	}
	

	return 0;
}

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

include <stdio.h>
#define N 200000
main(){

  int k = 0,n,A[N],B[N],C[N];
  int i;

  scanf("%d",&n);

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

  k = k + 1;

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

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

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

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

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

  printf("\n");

  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 M 2000001
void CouSort(int *A,int k,int n){
  int i,j,B[M],C[M];
  for(i=0;i<k;i++)
    C[i]=0;
  for(j=0;j<n;j++)
    C[A[j]]++;
  /* C[i]にはiの出現数が記録されている*/
  for(i=1;i<k;i++)
    C[i] = C[i] + C[i-1];
  /* C[i]にはi以下の数の出現数が記録されている*/
  for(j=n-1;j>=0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<n;i++)
    printf("%d ",B[i]);
  printf("%d\n",B[n]);
}
main(){
  int n,i,A[M];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]); 
  CouSort(A,,n);
  return 0;
}

Compiler output:
main.c:21:1: error: return type defaults to 'int' [-Wimplicit-int]
   21 | main(){
      | ^~~~
main.c: In function 'main':
main.c:26:13: error: expected expression before ',' token
   26 |   CouSort(A,,n);
      |             ^
Language: C

include<stdio.h>
#define M 200000
void CouSort(int *A,int k,int n){
  int i,j,B[M],C[10000];
  for(i=0;i<k;i++)
    C[i]=0;
  for(j=0;j<n;j++)
    C[A[j]]++;
  /* C[i]にはiの出現数が記録されている*/
  for(i=1;i<k;i++)
    C[i] = C[i] + C[i-1];
  /* C[i]にはi以下の数の出現数が記録されている*/
  for(j=n-1;j>=0;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  for(i=1;i<n;i++)
    printf("%d ",B[i]);
  printf("%d\n",B[n]);
}
main(){
  int n,i,A[M];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]);
  CouSort(A,10000,n);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c:21:1: error: return type defaults to 'int' [-Wimplicit-int]
   21 | main(){
      | ^~~~
main.c: In function 'main':
main.c:23:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   23 |   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:23:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   23 |   scanf("%d",&n);
      |   ^~~~~
main.c:23:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:26:3: error: implicit declaration of function 'CouSort' [-Wimplicit-function-declaration]
   26 |   CouSort(A,10000,n);
      |   ^~~~~~~
Language: C

main(){
  int i, j, k = 0, n, A[N], B[N], C[N];
  scanf("%d", &n);
  for(i = 1;i < n+1;i++){
    scanf("%d", &A[i]);
    if(A[i] >= k){
      k = A[i];
    }
  }
  for(i = 0;i < k+1;i++){
    C[i] = 0;
  }
  for(j = 1;j < n;j++){
    C[A[j]]++;
  }
  for(i = 1;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-1;i++){
    printf("%d ", B[i]);
}
  printf("%d\n", B[n-1]);
  return 0;
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:2:25: error: 'N' undeclared (first use in this function)
    2 |   int i, j, k = 0, n, A[N], B[N], C[N];
      |                         ^
main.c:2:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 |     printf("%d ", B[i]);
      |     ^~~~~~
main.c:24:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   26 |   printf("%d\n", B[n-1]);
      |   ^~~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <stdio.h>


void Counting_Sort(int A[],int *B,int k,int length){
	int i,j,C[10000];
	for (i = 0; i <= k; i++){
		C[i] = 0;
	}
	for (j = 0; j < length;j++){
		C[A[j]]++;
	}
	/* C[i]にはiの出現数が記録されている*/
	for (i = 1; i <= k; i++){
		C[i] = C[i] + C[i - 1];
	}
	/* C[i]にはi以下の数の出現数が記録されている*/
	for (j = length-1; j >= 0; j--){
		B[C[A[j]]] = A[j];
		printf("%d", B[C[A[j]]]);
			C[A[j]] --;
	}
	
}

void main(){
	int n, i, A[2000], B[2000], max = -1;
	scanf("%d",&n);
	for (i = 0; i < n;i++){
		scanf("%d",&A[i]);
		if (max<A[i]){max = A[i];}
	}

	Counting_Sort(A, B, max,n);

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

}

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

#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <stdio.h>


void Counting_Sort(int A[],int *B,int k,int length){
	int i,j,C[10000];
	for (i = 0; i <= k; i++){
		C[i] = 0;
	}
	for (j = 0; j < length;j++){
		C[A[j]]++;
	}
	/* C[i]にはiの出現数が記録されている*/
	for (i = 1; i <= k; i++){
		C[i] = C[i] + C[i - 1];
	}
	/* C[i]にはi以下の数の出現数が記録されている*/
	for (j = length-1; j >= 0; j--){
		B[C[A[j]]] = A[j];
		printf("%d", B[C[A[j]]]);
			C[A[j]] --;
	}
	
}

void main(){
	int n, i, A[2000], B[2000], max = -1;
	scanf("%d",&n);
	for (i = 0; i < n;i++){
		scanf("%d",&A[i]);
		if (max<A[i]){max = A[i];}
	}

	Counting_Sort(A, B, max,n);

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

}

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

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
 
 /*
void Counting_Sort(int *A,int *B,int k,int length){
  int i,j,C[100000];
  for (i = 0; i <= k; i++){
    C[i] = 0;
  }
  for (j = 1; j <= length;j++){
    C[A[j]]++;
  }
  /* C[i]にはiの出現数が記録されている*/
  for (i = 1; i <= k; i++){
    C[i] = C[i] + C[i - 1];
  }
  /* C[i]にはi以下の数の出現数が記録されている*/
  for (j = length; j >= 1; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
}
*/
int main(){
  int n, i, A[2000001], B[2000001], max = -1;
  scanf("%d",&n);
  for (i = 1; i <= n;i++){
    scanf("%d",&A[i]);
    if (max<A[i]){max = A[i];}
  }
   
  //Counting_Sort(A, B, max,n);
   
  for (i = 1; i <= n;i++){
    printf("%d",B[i]);
    if (i < n){
      printf(" ");
    }
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c:14:3: error: expected identifier or '(' before 'for'
   14 |   for (i = 1; i <= k; i++){
      |   ^~~
main.c:14:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   14 |   for (i = 1; i <= k; i++){
      |                 ^~
main.c:14:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   14 |   for (i = 1; i <= k; i++){
      |                        ^~
main.c:18:3: error: expected identifier or '(' before 'for'
   18 |   for (j = length; j >= 1; j--){
      |   ^~~
main.c:18:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   18 |   for (j = length; j >= 1; j--){
      |                      ^~
main.c:18:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   18 |   for (j = length; j >= 1; j--){
      |                             ^~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
main.c:23:2: error: expected identifier or '(' before '/' token
   23 | */
      |  ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
 
/*
void Counting_Sort(int *A,int *B,int k,int length){
  int i,j,C[100000];
  for (i = 0; i <= k; i++){
    C[i] = 0;
  }
  for (j = 1; j <= length;j++){
    C[A[j]]++;
  }
  /* C[i]にはiの出現数が記録されている*/
  for (i = 1; i <= k; i++){
    C[i] = C[i] + C[i - 1];
  }
  /* C[i]にはi以下の数の出現数が記録されている*/
  for (j = length; j >= 1; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
}
*/
int main(){
  int n, i, A[2000001], B[2000001], max = -1;
  scanf("%d",&n);
  for (i = 1; i <= n;i++){
    scanf("%d",&A[i]);
    if (max<A[i]){max = A[i];}
  }
   
  //Counting_Sort(A, B, max,n);
   
  for (i = 1; i <= n;i++){
    printf("%d",B[i]);
    if (i < n){
      printf(" ");
    }
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c:14:3: error: expected identifier or '(' before 'for'
   14 |   for (i = 1; i <= k; i++){
      |   ^~~
main.c:14:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   14 |   for (i = 1; i <= k; i++){
      |                 ^~
main.c:14:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   14 |   for (i = 1; i <= k; i++){
      |                        ^~
main.c:18:3: error: expected identifier or '(' before 'for'
   18 |   for (j = length; j >= 1; j--){
      |   ^~~
main.c:18:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   18 |   for (j = length; j >= 1; j--){
      |                      ^~
main.c:18:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   18 |   for (j = length; j >= 1; j--){
      |                             ^~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
main.c:23:2: error: expected identifier or '(' before '/' token
   23 | */
      |  ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
 
/*
void Counting_Sort(int *A,int *B,int k,int length){
  int i,j,C[100000];
  for (i = 0; i <= k; i++){
    C[i] = 0;
  }
  for (j = 1; j <= length;j++){
    C[A[j]]++;
  }
  /* C[i]にはiの出現数が記録されている*/
  for (i = 1; i <= k; i++){
    C[i] = C[i] + C[i - 1];
  }
  /* C[i]にはi以下の数の出現数が記録されている*/
  for (j = length; j >= 1; j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
}
*/

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

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

Compiler output:
main.c:14:3: error: expected identifier or '(' before 'for'
   14 |   for (i = 1; i <= k; i++){
      |   ^~~
main.c:14:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   14 |   for (i = 1; i <= k; i++){
      |                 ^~
main.c:14:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   14 |   for (i = 1; i <= k; i++){
      |                        ^~
main.c:18:3: error: expected identifier or '(' before 'for'
   18 |   for (j = length; j >= 1; j--){
      |   ^~~
main.c:18:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   18 |   for (j = length; j >= 1; j--){
      |                      ^~
main.c:18:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   18 |   for (j = length; j >= 1; j--){
      |                             ^~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
main.c:23:2: error: expected identifier or '(' before '/' token
   23 | */
      |  ^
Language: C

#include<stdio.h>
#define N 2000000

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

Compiler output:
main.c: In function 'main':
main.c:10:19: error: expected expression before ';' token
   10 |         for(i=1;i<;i++) C[i] = C[i] + C[i-1];
      |                   ^
Language: C

#include<stdio.h>
#define MAX 1000
 
int A[MAX],B[MAX],C[MAX];
int main(){
    int n,i;
 
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
for(i = 1;i <= n;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 >= 1;i--){
    B[C[A[i]]] = A[i];
    C[A[i]]--;
}

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

Compiler output:
main.c: In function 'main':
main.c:28:19: error: expected ';' before '}' token
   28 |     printf("%d\n")
      |                   ^
      |                   ;
   29 |       }else{
      |       ~
Language: C

#include<stdio.h>
#define N 2000000

int *CountingSort(int *,int *,int);
int k=10;

int main(){

  int k,n;
  int A[N],B[N];
  int i=0,j;

  //input 
  scanf("%d",&n);

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

  //sort 
  CountingSort(&A[0],&B[0],n);

  //output
  for(i=0 ; i<n ; i++){
    printf("%d ",A[i]);
  }

  return 0;
}

int *CountingSort(int *A,,int *B,int n){
  int C[N];

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

  for(j=0 ; 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]]--;
  }

  return B;
}

Compiler output:
main.c:31:26: error: expected declaration specifiers or '...' before ',' token
   31 | int *CountingSort(int *A,,int *B,int n){
      |                          ^
main.c:46:3: error: expected identifier or '(' before 'for'
   46 |   for(j=n ; j>0 ; j--){
      |   ^~~
main.c:46:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
   46 |   for(j=n ; j>0 ; j--){
      |              ^
main.c:46:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   46 |   for(j=n ; j>0 ; j--){
      |                    ^~
main.c:51:3: error: expected identifier or '(' before 'return'
   51 |   return B;
      |   ^~~~~~
main.c:52:1: error: expected identifier or '(' before '}' token
   52 | }
      | ^
Language: C

#include<stdio.h>
#define Z 2000000
int a[Z],b[Z],c[Z];
main()
 {
  int i,j,k,l=0;
  scanf("%d", &k);
  for(i=0;i<k;i++)
    {
      scanf("%d", &a[i]);
      c[a[i]]+=1;  
      if(a[i] > l)
        {
	  l = a[i];
        }
    }  
  for(i=1;i<=l;i++)
    {
      c[i] = c[i] + c[i-1];
    }

  for(j = k-1;j>=0;j--)
    {

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:23:5: error: expected declaration or statement at end of input
   23 |     {
      |     ^
main.c:23:5: error: expected declaration or statement at end of input
Language: C

package algo;

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	public void solve() {
		int n;
		int[] A;
		int[] B;
		int k = 0;

		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		A = new int[n];
		B = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
			if (k < A[i]) {
				k = A[i];
			}
		}

		sc.close();

		coutingSort(A, B, k);

		for (int i = 0; i < B.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(B[i]);
		}
		System.out.println();
	
	}

//	private int[] inputArray(int[] array) {
//		Scanner sc = new Scanner(System.in);
//
//		n = sc.nextInt();
//		array = new int[n];
//		for (int i = 0; i < array.length; i++) {
//			array[i] = sc.nextInt();
//			if (k < array[i]) {
//				k = array[i];
//			}
//		}
//
//		sc.close();
//		return array;
//	}

	private int[] coutingSort(int[] array, int[] sortedArray, int k) {
		int[] C = new int[k + 1];

		for (int j = 0; j < array.length; j++) {
			C[array[j]]++;
		}

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

		for (int j = array.length - 1; j >= 0; j--) {
			sortedArray[C[array[j]] - 1] = array[j];
			C[array[j]]--;
		}

		return sortedArray;
	}

//	private void displayArray(int[] array) {
//		for (int i = 0; i < array.length; i++) {
//			if (i > 0) {
//				System.out.print(" ");
//			}
//			System.out.print(array[i]);
//		}
//		System.out.println();
//	}

}

Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package algo;
      | ^~~~~~~
main.c:3:1: error: unknown type name 'import'
    3 | import java.util.Scanner;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.util.Scanner;
      |            ^
main.c:5:1: error: unknown type name 'class'
    5 | class Main {
      | ^~~~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | class Main {
      |            ^
Language: C

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	public void solve() {
		int n;
		int[] A;
		int[] B;
		int k = 0;

		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		A = new int[n];
		B = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
			if (k < A[i]) {
				k = A[i];
			}
		}

		sc.close();

		coutingSort(A, B, k);

		for (int i = 0; i < B.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(B[i]);
		}
		System.out.println();
	
	}

//	private int[] inputArray(int[] array) {
//		Scanner sc = new Scanner(System.in);
//
//		n = sc.nextInt();
//		array = new int[n];
//		for (int i = 0; i < array.length; i++) {
//			array[i] = sc.nextInt();
//			if (k < array[i]) {
//				k = array[i];
//			}
//		}
//
//		sc.close();
//		return array;
//	}

	private int[] coutingSort(int[] array, int[] sortedArray, int k) {
		int[] C = new int[k + 1];

		for (int j = 0; j < array.length; j++) {
			C[array[j]]++;
		}

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

		for (int j = array.length - 1; j >= 0; j--) {
			sortedArray[C[array[j]] - 1] = array[j];
			C[array[j]]--;
		}

		return sortedArray;
	}

//	private void displayArray(int[] array) {
//		for (int i = 0; i < array.length; i++) {
//			if (i > 0) {
//				System.out.print(" ");
//			}
//			System.out.print(array[i]);
//		}
//		System.out.println();
//	}

}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main {
      | ^~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Main {
      |            ^
Language: C

package algo;

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	public void solve() {
		int k = 0;

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
			if (k < A[i]) {
				k = A[i];
			}
		}

		sc.close();

		coutingSort(A, B, k);

		for (int i = 0; i < B.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(B[i]);
		}
		System.out.println();
	
	}

//	private int[] inputArray(int[] array) {
//		Scanner sc = new Scanner(System.in);
//
//		n = sc.nextInt();
//		array = new int[n];
//		for (int i = 0; i < array.length; i++) {
//			array[i] = sc.nextInt();
//			if (k < array[i]) {
//				k = array[i];
//			}
//		}
//
//		sc.close();
//		return array;
//	}

	private void coutingSort(int[] array, int[] sortedArray, int k) {
		int[] C = new int[k + 1];

		for (int j = 0; j < array.length; j++) {
			C[array[j]]++;
		}

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

		for (int j = array.length - 1; j >= 0; j--) {
			sortedArray[C[array[j]] - 1] = array[j];
			C[array[j]]--;
		}
	}

//	private void displayArray(int[] array) {
//		for (int i = 0; i < array.length; i++) {
//			if (i > 0) {
//				System.out.print(" ");
//			}
//			System.out.print(array[i]);
//		}
//		System.out.println();
//	}

}

Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package algo;
      | ^~~~~~~
main.c:3:1: error: unknown type name 'import'
    3 | import java.util.Scanner;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.util.Scanner;
      |            ^
main.c:5:1: error: unknown type name 'class'
    5 | class Main {
      | ^~~~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | class Main {
      |            ^
Language: C

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	public void solve() {
		int k = 0;

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
			if (k < A[i]) {
				k = A[i];
			}
		}

		sc.close();

		coutingSort(A, B, k);

		for (int i = 0; i < B.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(B[i]);
		}
		System.out.println();
	
	}

//	private int[] inputArray(int[] array) {
//		Scanner sc = new Scanner(System.in);
//
//		n = sc.nextInt();
//		array = new int[n];
//		for (int i = 0; i < array.length; i++) {
//			array[i] = sc.nextInt();
//			if (k < array[i]) {
//				k = array[i];
//			}
//		}
//
//		sc.close();
//		return array;
//	}

	private void coutingSort(int[] array, int[] sortedArray, int k) {
		int[] C = new int[k + 1];

		for (int j = 0; j < array.length; j++) {
			C[array[j]]++;
		}

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

		for (int j = array.length - 1; j >= 0; j--) {
			sortedArray[C[array[j]] - 1] = array[j];
			C[array[j]]--;
		}
	}

//	private void displayArray(int[] array) {
//		for (int i = 0; i < array.length; i++) {
//			if (i > 0) {
//				System.out.print(" ");
//			}
//			System.out.print(array[i]);
//		}
//		System.out.println();
//	}

}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main {
      | ^~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Main {
      |            ^
Language: C

#include<stdio.h>
#define N 2000000

void countingSort(int[],int[],int);

int n=0;
int B[N];

int main(){
  int A[N];
  int k=0,i;

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

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

  return 0;
}

void countingSort(int A[],int B[],int k){

  int i,j;
  int C[k];

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

   int i,j;
   int C[k];

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

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

  for(j=0;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");
}

Compiler output:
main.c: In function 'countingSort':
main.c:44:11: error: redeclaration of 'C' with no linkage
   44 |    }  int C[k];
      |           ^
main.c:40:8: note: previous declaration of 'C' with type 'int[k]'
   40 |    int C[k];
      |        ^
main.c: In function 'countingSort':
main.c:69:1: error: expected declaration or statement at end of input
   69 | }
      | ^
Language: C

#include<stdio.h>
#define N 2000000

void countingSort(int[],int[],int);

int n=0;
int B[N];

int main(){
  int A[N];
  int k=0,i;

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

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

  return 0;
}

void countingSort(int A[],int B[],int k){

  int i,j;
  int C[k];

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

   int i,j;
   int C[k];

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

  for(j=0;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");
}

Compiler output:
main.c: In function 'countingSort':
main.c:65:1: error: expected declaration or statement at end of input
   65 | }
      | ^
Language: C

#include<stdio.h>
#define N 20000000000
void CountingSort(int);

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



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


void CountingSort(int k){
  int i, j, C[N];
  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:
/tmp/ccT9p9ko.o: in function `main':
main.c:(.text+0xcc): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccT9p9ko.o
/tmp/ccT9p9ko.o: in function `CountingSort':
main.c:(.text+0x29d): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccT9p9ko.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

int  B[100000], C[100000];

void CountingSort(int A[100000], int k, int n);
  
 


int main(){
  
  int i, n, max = 0, A[100000];
  scanf("%d", &n);

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

    if(A[i] > max) max = A[i];
     
  }
  

CountingSort(A, max, n);
 
 printf("\n");
}   
  
void CountingSort(int A[100000], int k, int n){
  
  int i, j;
  
 
  for(i = 0 ; i <= k ; i++){
    
    C[i] = 0;
  
  }
  
    for(j = 1 ; j <= n ; j++){
      
      C[A[j]] = C[A[j]]+1;
      
    }

  
  
  for(i = 1 ; i <= k ; i++){
    
    C[i] = C[i] + C[i - 1];
  }
  
  for(j = n ; j >= 1 ; #include <stdio.h>

int  B[100000], C[100000];

void CountingSort(int A[100000], int k, int n);
  
 


int main(){
  
  int i, n, max = 0, A[100000];
  scanf("%d", &n);

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

    if(A[i] > max) max = A[i];
     
  }
  

CountingSort(A, max, n);
 
 printf("\n");
}   
  
void CountingSort(int A[100000], int k, int n){
  
  int i, j;
  
 
  for(i = 0 ; i <= k ; i++){
    
    C[i] = 0;
  
  }
  
    for(j = 1 ; j <= n ; j++){
      
      C[A[j]] = C[A[j]]+1;
      
    }

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

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

Compiler output:
main.c: In function 'CountingSort':
main.c:53:24: error: stray '#' in program
   53 |   for(j = n ; j >= 1 ; #include <stdio.h>
      |                        ^
main.c:53:25: error: 'include' undeclared (first use in this function)
   53 |   for(j = n ; j >= 1 ; #include <stdio.h>
      |                         ^~~~~~~
main.c:53:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:53:34: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   53 |   for(j = n ; j >= 1 ; #include <stdio.h>
      |                                  ^~~~~
      |                                  stdin
main.c:55:1: error: expected expression before 'int'
   55 | int  B[100000], C[100000];
      | ^~~
Language: C

#include <stdio.h>

#define N 2000001
#define M 10000

int  B[N], C[M];

void CountingSort(int A[N], int k, int n);
  
 


int main(){
  
  int i, max = 0, A[N];
  scanf("%d", &n);

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

    if(A[i] > max) max = A[i];
     
  }
  

CountingSort(A, max, n);

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

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

Compiler output:
main.c: In function 'main':
main.c:16:16: error: 'n' undeclared (first use in this function)
   16 |   scanf("%d", &n);
      |                ^
main.c:16:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int 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];
    }
  }
 
  CountingSort( max );
   
  for( i = 1; i <= n; i++ ){
    if(i > 1) printf(" ");
    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 = 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: In function 'main':
main.c:7:16: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d", &n);
      |                ^
main.c:7:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:18: error: 'A' undeclared (first use in this function)
   10 |     scanf("%d", &A[i]);
      |                  ^
main.c:16:3: error: implicit declaration of function 'CountingSort' [-Wimplicit-function-declaration]
   16 |   CountingSort( max );
      |   ^~~~~~~~~~~~
main.c:20:18: error: 'B' undeclared (first use in this function)
   20 |     printf("%d", B[i]);
      |                  ^
main.c: At top level:
main.c:26:6: warning: conflicting types for 'CountingSort'; have 'void(int)'
   26 | void CountingSort( int k ){
      |      ^~~~~~~~~~~~
main.c:16:3: note: previous implicit declaration of 'CountingSort' with type 'void(int)'
   16 |   CountingSort( max );
      |   ^~~~~~~~~~~~
main.c: In function 'CountingSort':
main.c:31:5: error: 'C' undeclared (first use in this function)
   31 |     C[i] = 0;
      |     ^
main.c:33:20: error: 'n' undeclared (first use in this function)
   33 |   for( j = 1; j <= n; j++ ){
      |                    ^
main.c:34:8: error: 'A' undeclared (first use in this function)
   34 |      C[A[j]]++;
      |        ^
main.c:40:5: error: 'B' undeclared (first use in this function)
   40 |     B[C[A[j]]] = A[j];
      |     ^
Language: C

#include<stdio.h>
#define N 2000001
#define M 10001

void CountingSort(int);

int A[N],B[N],C[M],n=0;

int main(){

  int i,j,t;

  scanf("%d",&n)#include<stdio.h>
#define N 2000001
#define M 10001

void CountingSort(int);

int A[N],B[N],C[M],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 (i = 0; i <= k; i++) {
      C[i] = C[i]+C[i-1];
    }

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

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

  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 (i = 0; i <= k; i++) {
      C[i] = C[i]+C[i-1];
    }

  for(j = 0; j < n; j++) {
    C[A[j]] = C[A[j]]+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: In function 'main':
main.c:13:17: error: stray '#' in program
   13 |   scanf("%d",&n)#include<stdio.h>
      |                 ^
main.c:13:17: error: expected ';' before 'include'
   13 |   scanf("%d",&n)#include<stdio.h>
      |                 ^~~~~~~~
      |                 ;
Language: C

#include <stdio.h>

#define N 2000000
#define M 10000

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

void CountingSort(int);
  
 


int main(){
  
  int i,n, max = 0, A[N];
  scanf("%d", &n);

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

    if(A[i] > max) max = A[i];
     
  }
  

CountingSort(max);

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

 }
 printf("\n");

 return 0;
}   
  
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]] = C[A[j]]+1;
      
    }

  
  
  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]] = C[A[j]]-1;
    
  }
  
 
}
 

Compiler output:
main.c: In function 'CountingSort':
main.c:51:22: error: 'n' undeclared (first use in this function)
   51 |     for(j = 1 ; j <= n ; j++){
      |                      ^
main.c:51:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int  B[100000],C[100000],n;

void CountingSort(int A[100000],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]]=C[A[j]]+1;
  }
  
  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]]=C[A[j]]-1;   
  }
  
  for(i=1;i<=n;i++){
    printf("%d ",B[i]);
  }

  printf("\n");
  return 0;
}

int main(){  
  int i,max=0,A[100000];

  scanf("%d",&n);

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

  CountingSort(A,max,n);
  return 0;
}

Compiler output:
main.c: In function 'CountingSort':
main.c:21:6: error: subscripted value is neither array nor pointer nor vector
   21 |     B[C[A[j]]]=A[j];
      |      ^
main.c:26:19: error: subscripted value is neither array nor pointer nor vector
   26 |     printf("%d ",B[i]);
      |                   ^
main.c:30:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   30 |   return 0;
      |          ^
main.c:5:6: note: declared here
    5 | void CountingSort(int A[100000],int B,int k){
      |      ^~~~~~~~~~~~
Language: C

#include <stdio.h>

int  B[100000],C[100000];

void CountingSort(int ,int ,int);

int main(){  
  int i,n,max=0,A[100000];

  scanf("%d",&n);

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

  CountingSort(A,max,n);
  return 0;
}

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

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

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

  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:16: error: passing argument 1 of 'CountingSort' makes integer from pointer without a cast [-Wint-conversion]
   19 |   CountingSort(A,max,n);
      |                ^
      |                |
      |                int *
main.c:5:19: note: expected 'int' but argument is of type 'int *'
    5 | void CountingSort(int ,int ,int);
      |                   ^~~
main.c: At top level:
main.c:23:6: error: conflicting types for 'CountingSort'; have 'void(int *, int,  int)'
   23 | void CountingSort(int A[100000],int k,int n){
      |      ^~~~~~~~~~~~
main.c:5:6: note: previous declaration of 'CountingSort' with type 'void(int,  int,  int)'
    5 | void CountingSort(int ,int ,int);
      |      ^~~~~~~~~~~~
main.c: In function 'CountingSort':
main.c:48:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   48 |   return 0;
      |          ^
main.c:23:6: note: declared here
   23 | void CountingSort(int A[100000],int k,int n){
      |      ^~~~~~~~~~~~
Language: C

#include <stdio.h>

int  B[100000],C[100000];

void CountingSort(int ,int ,int);

int main(){  
  int i,n,max=0,A[100000];

  scanf("%d",&n);

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

  CountingSort(A,max,n);
  return 0;
}

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

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

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

  printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:19:16: error: passing argument 1 of 'CountingSort' makes integer from pointer without a cast [-Wint-conversion]
   19 |   CountingSort(A,max,n);
      |                ^
      |                |
      |                int *
main.c:5:19: note: expected 'int' but argument is of type 'int *'
    5 | void CountingSort(int ,int ,int);
      |                   ^~~
main.c: At top level:
main.c:23:6: error: conflicting types for 'CountingSort'; have 'void(int *, int,  int)'
   23 | void CountingSort(int A[100000],int k,int n){
      |      ^~~~~~~~~~~~
main.c:5:6: note: previous declaration of 'CountingSort' with type 'void(int,  int,  int)'
    5 | void CountingSort(int ,int ,int);
      |      ^~~~~~~~~~~~
Language: C

#include <stdio.h>

#define N 2000000
#define M 10000

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

void CountingSort(int);
int n;
 


int main(){
  
  int i,j, max = 0;
  scanf("%d", &n);

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

    if(A[i] > max) max = A[i];
     
 




  

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

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

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

Compiler output:
main.c: In function 'main':
main.c:69:1: error: expected declaration or statement at end of input
   69 | }
      | ^
Language: C

#include<stdio.h>
 
#define N2000000
#define M 100000
int A[N],B[N],C[M];
 
int main(){
  int n,i,j,max = 0;
 
   
  scanf("%d", &n);
  for( i = 1; i <= n; i++ ) {
    scanf("%d", &A[i]);
    if(A[i] > max){
      max=A[i];
    }
  }
   
  for(i=0;i<=max;i++){
    C[i]=0;
  }
   
  for(j=1;j<=n;j++){


    C[A[j]]=C[A[j]]+1;
  }


  for(i=1;i<=max;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("%d\n",B[n]);
   
  return 0;
}

Compiler output:
main.c:5:7: error: 'N' undeclared here (not in a function)
    5 | int A[N],B[N],C[M];
      |       ^