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

#include <stdio.h>

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

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

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

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

  for(i=1;i<=10000;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:12:5: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   12 |   A=malloc(sizeof(short)*n+1);
      |     ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:12:5: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   12 |   A=malloc(sizeof(short)*n+1);
      |     ^~~~~~
main.c:12:5: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:15:25: error: 'c' undeclared (first use in this function)
   15 |   for(i=0;i<=10000;i++) c[i]=0;
      |                         ^
main.c:15:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 2000001
 
int a[N],c[N],b[N];
 
int main(){
  int i,j,n,k=0;
    
  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+1; j++){
    c[a[j]] = c[a[j]] + 1
  }
 
  for(i = 1; i <= k; i++){
    c[i] = c[i] + c[i-1];
  }

Compiler output:
main.c: In function 'main':
main.c:21:26: error: expected ';' before '}' token
   21 |     c[a[j]] = c[a[j]] + 1
      |                          ^
      |                          ;
   22 |   }
      |   ~                       
main.c:26:3: error: expected declaration or statement at end of input
   26 |   }
      |   ^
Language: C

#include<stdio.h>
#define N 2000001
 
int a[N],c[N],b[N];
 
int main(){
  int i,j,n,k=0;
    
  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+1; j++){
    c[a[j]] = c[a[j]] + 1;
  }
 
  for(i = 1; i <= k; i++){
    c[i] = c[i] + c[i-1];
  }

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

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

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

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

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

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

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

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

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

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

  return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
#define hani 2000000
#define hani2 10000

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

  scanf("%d", &n);

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

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

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

  for(i=1;i<=hani2;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:8:9: error: 'VMAX' undeclared (first use in this function)
    8 |   int C[VMAX+1],n, i, j;
      |         ^~~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define NMAX 2000000
#define AMAX 10000

int main(){

  int i, n;
  int A[AMAX], B[AMAX], C[AMAX+1];
  
  scanf("%d", &n);

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

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

  for(i=1; i<n; i++){
    C[i] = C[i] + C[i-1];
  }
  
  for(i=n-1; i>=0; i--){
    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(" ");
  }
  printf("\n");
  
  return 0;
}

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



#include<stdio.h>
#include<stdlib.h>
#define N 2000001
#define G 10000

int main(){

  unsigned short *A,*B;
  int i,j,x,y,C[G+1];

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

Compiler output:
main.c: In function 'main':
main.c:43:14: error: expected ';' before 'return'
   43 |   printf(" ")
      |              ^
      |              ;
   44 | 
   45 |   return 0;
      |   ~~~~~~
Language: C

#include <stdio.h>

void cntsrt(int *, int *, int);

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

  cntsrt(A, B, n);

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

  return 0;
}

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

Compiler output:
main.c:20:29: error: unknown type name 'k'
   20 | void cntsrt(int *A, int *B, k){
      |                             ^
Language: C

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

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

  int C[VMAX+ 1];
  int n, i;

  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[Ai]] = 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:2:9: fatal error: stdio.lib: No such file or directory
    2 | #include<stdio.lib>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

include<stdio.h>
#define MAX 200000
#define max 10000

int main(){
  int n, i;
  int A[MAX+1], B[MAX+1], C[max+1];

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

  for(i = 0; i < max+1; i++)
    C[i] = 0;>
#define MAX 200000
#define max 10000

int main(){
  int n, i;
  int A[MAX+1], B[MAX+1], C[max+1];

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


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

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

  printf("\n");

  return 0;
}

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

    scanf("%hu",&A[i + 1]);

Compiler output:
main.c:1:11: error: expected declaration specifiers or '...' before string constant
    1 |     scanf("%hu",&A[i + 1]);
      |           ^~~~~
main.c:1:17: error: expected declaration specifiers or '...' before '&' token
    1 |     scanf("%hu",&A[i + 1]);
      |                 ^
Language: C

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

void CountingSort(int);

#define MAX 1000
int *A,*B,*C;
int N;

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

  CountingSort(MAX);

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

  free(A);
  free(B);
  free(C);
  return 0;
}

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

  for(i=0;i<k;i++){
    C[i] = 0
  }
  /* C[i] ??? i ???????????°????¨?????????? */
  for(j=1;j<=N;j++){
    C[A[j]]++;
  }

  /* C[i] ??? i ??\????????°???????????°????¨??????????*/
  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: In function 'CountingSort':
main.c:40:13: error: expected ';' before '}' token
   40 |     C[i] = 0
      |             ^
      |             ;
   41 |   }
      |   ~
Language: C

#include <stdio.h>
#define MAX 2000000
void CountingSort(int, int);
int A[MAX], B[MAX];
int main(){
        int n, i, k=0;
            scanf("%d", &n);
        for(i= 0; i<n; i++) {
                     scanf("%d", &A[i]);
                if(k<A[i]) k = A[i];
        }

        CountingSort(k, n);

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

Compiler output:
main.c: In function 'main':
main.c:17:36: error: expected ';' before '}' token
   17 |                 if(i<n) printf(" ")
      |                                    ^
      |                                    ;
   18 |         }
      |         ~
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<MAX;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:31:3: error: expected declaration or statement at end of input
   31 |   return 0;
      |   ^~~~~~
Language: C

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

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

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

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

#include<stdio.h>
#define MAX 2000000
#define UL 10000

int n;
int C[UL];

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

    for(j = 1; i < n; i++)
        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]]--;
    }
}

int main()
{
	int i, k = UL;
	int *A, *B;

	scanf("%d", &n);

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

	countingSort(A, B, k);

	for (int 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:33:20: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   33 |         A = (int *)malloc(sizeof(int) * (n + 1));
      |                    ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | #define MAX 2000000
main.c:33:20: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   33 |         A = (int *)malloc(sizeof(int) * (n + 1));
      |                    ^~~~~~
main.c:33:20: note: include '<stdlib.h>' or provide a declaration of 'malloc'
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=1;i<=VMAX;i++)C[i]=0;
	
	for(i=0;i<n;i++){
		scanf("%hu",&A[i+1]);
		C[A[i+1]]++;
	}
	
	for(j=1;j<=n;j++){
		B[C[A[j]]]=a[j];
		C[A[j]]--;
	}
	
	for(i=1;i<=VMAX;i++){
		if(i>1)printf(" ");
		printf("%d",B[i]);
	}
	printf("\n");
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:28: error: 'a' undeclared (first use in this function)
   24 |                 B[C[A[j]]]=a[j];
      |                            ^
main.c:24:28: 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(){
  using 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:7:3: error: 'using' undeclared (first use in this function)
    7 |   using short *A,*B;
      |   ^~~~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:8: error: expected ';' before 'short'
    7 |   using short *A,*B;
      |        ^~~~~~
      |        ;
main.c:13:3: error: 'A' undeclared (first use in this function)
   13 |   A = malloc(sizeof(short) * n + 1);
      |   ^
main.c:14:3: error: 'B' undeclared (first use in this function)
   14 |   B = malloc(sizeof(short) * n + 1);
      |   ^
Language: C

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

int main()
{
	unsighned 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(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:4:9: error: macro names must be identifiers
    4 | #define 10000
      |         ^~~~~
main.c: In function 'main':
main.c:8:9: error: 'unsighned' undeclared (first use in this function)
    8 |         unsighned short *A,*B;
      |         ^~~~~~~~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:18: error: expected ';' before 'short'
    8 |         unsighned short *A,*B;
      |                  ^~~~~~
      |                  ;
main.c:10:15: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
   10 |         int C[VMAX+1];
      |               ^~~~
      |               MAX
main.c:14:9: error: 'A' undeclared (first use in this function)
   14 |         A=malloc(sizeof(short)*n+1);
      |         ^
main.c:15:9: error: 'B' undeclared (first use in this function)
   15 |         B=malloc(sizeof(short)*n+1);
      |         ^
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,j,i;
	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+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:18:19: error: expected expression before '[' token
   18 |                 C[[A[i+1]]++;
      |                   ^
main.c:18:29: error: expected ']' before ';' token
   18 |                 C[[A[i+1]]++;
      |                             ^
      |                             ]
main.c:18:30: error: expected ';' before '}' token
   18 |                 C[[A[i+1]]++;
      |                              ^
      |                              ;
   19 |         }
      |         ~
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,j,i;
	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+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:18:19: error: expected expression before '[' token
   18 |                 C[[A[i+1]]]++;
      |                   ^
Language: C

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

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

	return 0;
}

Compiler output:
main.c: In function 'mian':
main.c:33:20: error: 'ni' undeclared (first use in this function); did you mean 'i'?
   33 |         for(i=1;i<=ni++)
      |                    ^~
      |                    i
main.c:33:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:24: error: expected ';' before ')' token
   33 |         for(i=1;i<=ni++)
      |                        ^
      |                        ;
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define 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(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:4:9: error: macro names must be identifiers
    4 | #define 10000
      |         ^~~~~
main.c: In function 'main':
main.c:10:15: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
   10 |         int C[VMAX+1];
      |               ^~~~
      |               MAX
main.c:10:15: 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 mian()
{
	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<=ni++)
	{
		if(i>1)printf(" ");
		printf("%d",B[i]);
	}
	printf("\n");

	return 0;
}

Compiler output:
main.c: In function 'mian':
main.c:33:20: error: 'ni' undeclared (first use in this function); did you mean 'i'?
   33 |         for(i=1;i<=ni++)
      |                    ^~
      |                    i
main.c:33:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:24: error: expected ';' before ')' token
   33 |         for(i=1;i<=ni++)
      |                        ^
      |                        ;
Language: C

int main(void){
	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:4:15: error: 'VMAX' undeclared (first use in this function)
    4 |         int C[VMAX+1];
      |               ^~~~
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:11: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |         A=malloc(sizeof(short)*n+1);
      |           ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 | int main(void){
main.c:8:11: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |         A=malloc(sizeof(short)*n+1);
      |           ^~~~~~
main.c:8:11: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:26:24: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |                 if(i>1)printf(" ");
      |                        ^~~~~~
main.c:26:24: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:24: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:24: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:27:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   27 |                 printf("%d",B[i]);
      |                 ^~~~~~
main.c:27:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   29 |         printf("\n");
      |         ^~~~~~
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define 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:4:9: error: macro names must be identifiers
    4 | #define 10000
      |         ^~~~~
main.c: In function 'main':
main.c:10:15: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
   10 |         int C[VMAX+1];
      |               ^~~~
      |               MAX
main.c:10:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#difine MAX 2000001
#difine 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:3:2: error: invalid preprocessing directive #difine; did you mean #define?
    3 | #difine MAX 2000001
      |  ^~~~~~
      |  define
main.c:4:2: error: invalid preprocessing directive #difine; did you mean #define?
    4 | #difine VMAX 10000
      |  ^~~~~~
      |  define
main.c: In function 'main':
main.c:9:15: error: 'VMAX' undeclared (first use in this function)
    9 |         int C[VMAX+1];
      |               ^~~~
main.c:9:15: 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=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<=ni++)
	{
		if(i>1)printf(" ");
		printf("%d",B[i]);
	}
	printf("\n");

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:33:20: error: 'ni' undeclared (first use in this function); did you mean 'i'?
   33 |         for(i=1;i<=ni++)
      |                    ^~
      |                    i
main.c:33:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:24: error: expected ';' before ')' token
   33 |         for(i=1;i<=ni++)
      |                        ^
      |                        ;
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<=ni++){
		if(i>1)printf(" ");
		printf("%d",B[i]);
	}
	printf("\n");

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:20: error: 'ni' undeclared (first use in this function); did you mean 'i'?
   30 |         for(i=1;i<=ni++){
      |                    ^~
      |                    i
main.c:30:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:24: error: expected ';' before ')' token
   30 |         for(i=1;i<=ni++){
      |                        ^
      |                        ;
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define 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:4:9: error: macro names must be identifiers
    4 | #define 10000
      |         ^~~~~
main.c: In function 'main':
main.c:10:15: error: 'VMAX' undeclared (first use in this function); did you mean 'MAX'?
   10 |         int C[VMAX+1];
      |               ^~~~
      |               MAX
main.c:10:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 10000
void csort(int, int*);
main()
{
        int i, n, *table;
        scanf("%d", &n);
        table = (int*)malloc(sizeof(int) * n);
        for (i= 0; i < n; i++) {
                scanf("%d", &table[i]);
        }
        csort(n, table);
        for (i= 0; i < n - 1; i++) {
        printf("%d ", table[i]);
    }
        printf("%d\n", table[i]);
        free(table);
}
void csort(int n, int *table)
{
        int i, work[n], count[MAX + 1] = {0};
        for (i = 0; i < n; i++) {
                int key = table[i];
                count[key]++;
        }
        for (i = 0; i < MAX; i++) {
        count[i + 1] += count[i];
    }
        for (i = 0; i < n; i++) {
        int key = table[i];
                work[--count[key]] = key;
    }
        for (i = 0; i < n; i++) {
        table[i] = work[i];



Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main()
      | ^~~~
main.c: In function 'csort':
main.c:35:9: error: expected declaration or statement at end of input
   35 |         table[i] = work[i];
      |         ^~~~~
main.c:35:9: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 10000
void csort(int, int*);
main()
{
        int i, n, *table;
        scanf("%d", &n);
        table = (int*)malloc(sizeof(int) * n);
        for (i= 0; i < n; i++) {
                scanf("%d", &table[i]);
        }
        csort(n, table);
        for (i= 0; i < n - 1; i++) {
        printf("%d ", table[i]);
    }
        printf("%d\n", table[i]);
        free(table);
}
void csort(int n, int *table)
{
        int i, work[n], count[MAX + 1] = {0};
        for (i = 0; i < n; i++) {
                int key = table[i];
                count[key]++;
        }
        for (i = 0; i < MAX; i++) {
        count[i + 1] += count[i];
    }
        for (i = 0; i < n; i++) {
        int key = table[i];
                work[--count[key]] = key;
    }
        for (i = 0; i < n; i++) {
        table[i] = work[i];
}


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


int main(int argc, char const *argv[])
{
    int n;
    scanf("%d", &n);

    int C[VMAX];
    for (int i = 0; i < VMAX; i++) {
        C[i] = 0;
    }
    
    unsigned short *A, *B;
    A = (unsigned short*)malloc(sizeof(unsigned short)*n + 1);
    B = (unsigned short*)malloc(sizeof(unsigned short)*n + 1);

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

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

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




Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |     scanf("%d", &n);
      |     ^~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:11: error: 'VMAX' undeclared (first use in this function)
    7 |     int C[VMAX];
      |           ^~~~
main.c:7:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:26: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   13 |     A = (unsigned short*)malloc(sizeof(unsigned short)*n + 1);
      |                          ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 | 
main.c:13:26: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   13 |     A = (unsigned short*)malloc(sizeof(unsigned short)*n + 1);
      |                          ^~~~~~
main.c:13:26: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:31:20: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   31 |         if (i > 1) printf(" ");
      |                    ^~~~~~
main.c:31:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:31:20: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:31:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   32 |         printf("%hu", B[i]);
      |         ^~~~~~
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
map <int ,int> mpa,mpb;
#define VMAX 100000
#define MAX 200000001

int main (){
  unsigned short *A,*B;
  int C[VMAX+1]={0};
  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=1;i<=n;i++) {
    scanf("%hu", &A[i]);
    C[A[i]]++;
  }
  for(i=1;i<=VMAX;i++) C[i]=C[i]+C[i-1];  
  for(i=1;i<=n;i++) {
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }
  for(i=1;i<=n;i++) {
    if(i) cout << " ";
    printf("%d", B[i]);
  }
  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 <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
map <int ,int> mpa,mpb;
#define VMAX 100000
#define MAX 200000001

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



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


#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define VMAX 100000
#define MAX 200000001

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


Compiler output:
main.c:4:1: error: unknown type name 'using'
    4 | using namespace std;
      | ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    4 | using namespace std;
      |                 ^~~
Language: C

#include <stdio.h>
#define element 2000000
void CountingSort(int *,int *,int);
int C[element],max=0;
int main(void){
  int n,A[element],B[element],i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(max<A[i])max=A[i];
  }
  C=(int *)malloc(sizeof(int)*max+1);
  CountingSort(A,B,n);
  for(i=0;i<n;i++){
    printf("%d",B[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\n");
  return 0;
}
void CountingSort(int *A,int *B,int k){
  int i;
  for(i=0;i<=k;i++)
    C[i]=0;

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

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

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


Compiler output:
main.c: In function 'main':
main.c:12:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   12 |   C=(int *)malloc(sizeof(int)*max+1);
      |            ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | #define element 2000000
main.c:12:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   12 |   C=(int *)malloc(sizeof(int)*max+1);
      |            ^~~~~~
main.c:12:12: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:12:4: error: assignment to expression with array type
   12 |   C=(int *)malloc(sizeof(int)*max+1);
      |    ^
Language: C

#include <stdio.h>
void CountingSort(int *,int *,int);
int C[10005];
int main(void){
  int n,A[2000000],B[2000000],i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(max<A[i])max=A[i];
  }
  CountingSort(A,B,n);
  for(i=0;i<n;i++){
    printf("%d",B[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\n");
  return 0;
}
void CountingSort(int *A,int *B,int k){
  int i;
  for(i=0;i<=k;i++)
    C[i]=0;
 
  /* C[i] に i の出現数を記録する */
  for(i=0;i<k;i++)
    C[A[i]]++;
 
  /* C[i] に i 以下の数の出現数を記録する*/
  for(i=1;i<=10000;i++)
    C[i]=C[i]+C[i-1];
 
  for(i=k-1;i>=0;i--){
    B[C[A[i]]-1]=A[i];
    C[A[i]]--;
  }
}


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

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



int main(){
  short *A,*B;
  short *C,max=0;
  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]);
    
if(A[i+1]>max)  max=A[i+1];

      
      
  }

  
 C=malloc(sizeof(short)*max);
  for(i=1;i<=n;i++) {
      C[A[i+1]]++;

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

  for(i=1;i<=n;j++){

    
    if(i>1) printf(" ");
    printf("%d",B[i]);
  }

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



Compiler output:
main.c: In function 'main':
main.c:32:14: error: 'nj' undeclared (first use in this function); did you mean 'j'?
   32 |   for(j=1;j<=nj++) {
      |              ^~
      |              j
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:18: error: expected ';' before ')' token
   32 |   for(j=1;j<=nj++) {
      |                  ^
      |                  ;
Language: C

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



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

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

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

      
      
  }

  
 C=malloc(sizeof(int)*max);
  for(i=1;i<=n;i++) {
      C[A[i+1]]++;

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

  for(i=1;i<=n;j++){

    
    if(i>1) printf(" ");
    printf("%d",B[i]);
  }

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



Compiler output:
main.c: In function 'main':
main.c:32:14: error: 'nj' undeclared (first use in this function); did you mean 'j'?
   32 |   for(j=1;j<=nj++) {
      |              ^~
      |              j
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:18: error: expected ';' before ')' token
   32 |   for(j=1;j<=nj++) {
      |                  ^
      |                  ;
Language: C

#include<stdio.h>


int A[1000000000];
int ans[10000000];
int c[1000000000];



int main(){

  
  int number;


  
  scanf("%d",&number);


  


  int i;

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

  
  

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

    c[A[i+1]]++;

    
  }


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

  }

  for(i=1;i<number+1;i++){
    ans[c[A[i]]]=A[i];
    c[A[i]]--;


   
  }
  
  
  for(i=1;i<=number;i++){
    if(i==number){printf("%d",ans[i]);}
    else{printf("%d ",ans[i]);}
  }

  printf("\n");

  
  return 0;
}





Compiler output:
/tmp/ccd6ugnA.o: in function `main':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0xcc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x116): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x174): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x1a0): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x1e3): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccd6ugnA.o
main.c:(.text+0x21b): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>


int A[1000000000];
int ans[10000000];
int c[10000000];



int main(){

  
  int number;


  
  scanf("%d",&number);


  


  int i;

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

  
  

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

    c[A[i+1]]++;

    
  }


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

  }

  for(i=1;i<number+1;i++){
    ans[c[A[i]]]=A[i];
    c[A[i]]--;


   
  }
  
  
  for(i=1;i<=number;i++){
    if(i==number){printf("%d",ans[i]);}
    else{printf("%d ",ans[i]);}
  }

  printf("\n");

  
  return 0;
}





Compiler output:
/tmp/ccfBqcBc.o: in function `main':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0xcc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x116): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x174): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x1a0): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x1e3): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccfBqcBc.o
main.c:(.text+0x21b): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#define X 10000;

void countingSort(int A[],int B[], int n){
  int i;
  int C[X+1];

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

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

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

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

int main(){

  int n;

  scanf("%d",&n);

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

  countingSort(A,B,n);

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

  return 0;
}



Compiler output:
main.c: In function 'countingSort':
main.c:2:16: error: expected ']' before ';' token
    2 | #define X 10000;
      |                ^
main.c:6:9: note: in expansion of macro 'X'
    6 |   int C[X+1];
      |         ^
main.c:8:15: error: expected expression before ';' token
    8 |   for(i=0;i<=X;i++){
      |               ^
main.c:9:5: error: 'C' undeclared (first use in this function)
    9 |     C[i] = 0;
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:15: error: expected expression before ';' token
   16 |   for(i=1;i<=X;i++){
      |               ^
main.c: In function 'main':
main.c:33:7: error: 'i' undeclared (first use in this function)
   33 |   for(i=0;i<n;i++){
      |       ^
Language: C

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

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

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

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

  for (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 (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:31:3: error: expected declaration or statement at end of input
   31 |   return 0;
      |   ^~~~~~
Language: C

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

int main(){
  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<=VMax;i++)c[i]=0;
  for(i=0;i<n;i++){
    scanf("%d",&a[i+1]);
    c[a[i+1]]++;
  }
  for(j=1;j<=VMax;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:8:9: error: 'VMax' undeclared (first use in this function); did you mean 'Max'?
    8 |   int c[VMax+1];
      |         ^~~~
      |         Max
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in