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

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
    
int main()
{
    int i;
    int* check = (int*) malloc(sizeof(int)*10);            
 
    for (i=0; i<999999; i++)
    {
        int num, j, count = 0;                
        scanf("%d", &num);  
        check = (int*) realloc(sizeof(int)*10);
    
        int k;
        for (k=0; k<num; k++)
        {
            check[k] = k;
        }
    
        for (j=2; j<sqrt(num); j++) 
        {
            if (check[j] == 0)
                continue;
                   
            int l;      
            for (l=2; l * j < num; l++)
            {               
                check[l * j] = 0;
            }           
        }

        for (j=2; j<num; j++)
        {
            if (check[j] != 0)
                printf("%d\n", j);
        }
        printf("%d\n", count);
    }
    free(check);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:32: error: passing argument 1 of 'realloc' makes pointer from integer without a cast [-Wint-conversion]
   14 |         check = (int*) realloc(sizeof(int)*10);
      |                                ^~~~~~~~~~~~~~
      |                                |
      |                                long unsigned int
In file included from main.c:2:
/usr/include/stdlib.h:683:29: note: expected 'void *' but argument is of type 'long unsigned int'
  683 | extern void *realloc (void *__ptr, size_t __size)
      |                       ~~~~~~^~~~~
main.c:14:24: error: too few arguments to function 'realloc'
   14 |         check = (int*) realloc(sizeof(int)*10);
      |                        ^~~~~~~
/usr/include/stdlib.h:683:14: note: declared here
  683 | extern void *realloc (void *__ptr, size_t __size)
      |              ^~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
    
int main()
{
    int i;
    int* check = (int*) malloc(sizeof(int)*10);            
 
    for (i=0; i<999999; i++)
    {
        int num, j, count = 0;                
        scanf("%d", &num);  
        check = (int*) realloc(sizeof(int)*10);
    
        int k;
        for (k=0; k<num; k++)
        {
            check[k] = k;
        }
    
        for (j=2; j<sqrt(num); j++) 
        {
            if (check[j] == 0)
                continue;
                   
            int l;      
            for (l=2; l * j < num; l++)
            {               
                check[l * j] = 0;
            }           
        }

        for (j=2; j<num; j++)
        {
            if (check[j] != 0)
                count++;
        }
        printf("%d\n", count);
    }
    free(check);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:32: error: passing argument 1 of 'realloc' makes pointer from integer without a cast [-Wint-conversion]
   14 |         check = (int*) realloc(sizeof(int)*10);
      |                                ^~~~~~~~~~~~~~
      |                                |
      |                                long unsigned int
In file included from main.c:2:
/usr/include/stdlib.h:683:29: note: expected 'void *' but argument is of type 'long unsigned int'
  683 | extern void *realloc (void *__ptr, size_t __size)
      |                       ~~~~~~^~~~~
main.c:14:24: error: too few arguments to function 'realloc'
   14 |         check = (int*) realloc(sizeof(int)*10);
      |                        ^~~~~~~
/usr/include/stdlib.h:683:14: note: declared here
  683 | extern void *realloc (void *__ptr, size_t __size)
      |              ^~~~~~~
Language: C

int main(){
	int num;
	int ans=0;
	int i,j,k;
	int box[100000];
		
	while(scanf("%d",&num)!=EOF){
		
		for(i=0;i<num;i++){
			for(j=0;j<num;j++)box[i]=1;
		}
		
		for(i=2;i<sqrt(num);i++){
			if(box[i]==1){
				for(j=2;i*j<num;j++){
					box[i*j]=0;
				}
			}
		}
		for(i=0;i<num;i++)if(box[i]==1)ans++;
		printf("%d\n",ans);
		ans=0;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |         while(scanf("%d",&num)!=EOF){
      |               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:7:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |         while(scanf("%d",&num)!=EOF){
      |               ^~~~~
main.c:7:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:33: error: 'EOF' undeclared (first use in this function)
    7 |         while(scanf("%d",&num)!=EOF){
      |                                 ^~~
main.c:7:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:7:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:27: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   13 |                 for(i=2;i<sqrt(num);i++){
      |                           ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | int main(){
main.c:13:27: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   13 |                 for(i=2;i<sqrt(num);i++){
      |                           ^~~~
main.c:13:27: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:21:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |                 printf("%d\n",ans);
      |                 ^~~~~~
main.c:21:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(){
  int i,j,total,n;
  while(scanf("%d",&n)!=0){
    total=n-1;
    for(i=2;i<=n;i++){
      for(j=2;j<i;j++){
	if(i%j==0){
	  total--;
	  break;
	}
      }
    }
    printf("%d\n"total);
  }
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:14:18: error: expected ')' before 'total'
   14 |     printf("%d\n"total);
      |           ~      ^~~~~
      |                  )
Language: C

#include<stdio.h>
int main(void){
int i,n,j,count=0;

while((scanf("%d",&n))!=EOF){
for(i=0;i<=n;i++){
for(j=0;j<i;j++){
if(i%j==0){
coount++;
break;
}
}
}
count=n-count;
printf("%d",count);
count=0;
}
return 0;
}

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

#include<stdio.h>

int main (void)
{
	int n,i,count,t,prime,l;
	for(l=0;l<30;l++	){
	scanf("%d",&n);
	1
	
	prime = 0;	
	for(t=1;t<=n;t++){
	 count= 0;
	 for(i=1;i<=t;i++){
		if(t%i == 0){
			count += 1;
		}else{
			;
		}
	 }
	if(count == 2){
	prime += 1;
	}else{
	 ;
	}
	}
	printf("%d\n",prime);
}
	return 0;
}
	

Compiler output:
main.c: In function 'main':
main.c:8:10: error: expected ';' before 'prime'
    8 |         1
      |          ^
      |          ;
    9 | 
   10 |         prime = 0;
      |         ~~~~~
Language: C

#include<stdio.h>

int main (void)
{
	int n,i,count,t,prime,l;
	for(l=0;l<30;l++	){
	scanf("%d",&n);
	1
	
	prime = 0;	
	for(t=1;t<=n;t++){
	 count= 0;
	 for(i=1;i<=t;i++){
		if(t%i == 0){
			count += 1;
		}else{
			;
		}
	 }
	if(count == 2){
	prime += 1;
	}else{
	 ;
	}
	}
	printf("%d\n",prime);
}
	return 0;
}
	
	

Compiler output:
main.c: In function 'main':
main.c:8:10: error: expected ';' before 'prime'
    8 |         1
      |          ^
      |          ;
    9 | 
   10 |         prime = 0;
      |         ~~~~~
Language: C

#include<stdio.h>

int main (void)
{
	int n,i,count,t,prime,l;
	for(l=0;l<30;l++){
	scanf("%d",&n);
	1
	
	prime = 0;	
	for(t=1;t<=n;t++){
	 count= 0;
	 for(i=1;i<=t;i++){
		if(t%i == 0){
			count += 1;
		}else{
			;
		}
	 }
	if(count == 2){
	prime += 1;
	}else{
	 ;
	}
	}
	printf("%d\n",prime);
}
	return 0;
}
	
	

Compiler output:
main.c: In function 'main':
main.c:8:10: error: expected ';' before 'prime'
    8 |         1
      |          ^
      |          ;
    9 | 
   10 |         prime = 0;
      |         ~~~~~
Language: C

#include<stdio.h>
int main(void)
int i,j,n;
while(scanf("%d",&n)!=EOF) {
int num[1000000]={0};
for(i=2;i<=n/2;i++) {
for(j=2;j*i<n;j++) {
num[i*j]++;
}
}
for(i=2;i<=n;i++) {
if(num[i]==0) 
printf("%d",&i);
} }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected declaration specifiers before 'while'
    4 | while(scanf("%d",&n)!=EOF) {
      | ^~~~~
main.c:15:1: error: expected declaration specifiers before 'return'
   15 | return 0;
      | ^~~~~~
main.c:16:1: error: expected declaration specifiers before '}' token
   16 | }
      | ^
main.c:2:5: error: old-style parameter declarations in prototyped function definition
    2 | int main(void)
      |     ^~~~
main.c:17: error: expected '{' at end of input
Language: C

#include<stdio.h>
int main(void) {
int i,j,n;
while(scanf("%d",&n)!=EOF) {
int num[1000000]={0};
for(i=2;i<=n/2;i++) {
for(j=2;j*i<n;j++) {
num[i*j]++;
}
}
for(i=2;i<=n;i++) {
if(num[i]==0) 
printf("%d",&i);
} } }
return 0;
}

Compiler output:
main.c:15:1: error: expected identifier or '(' before 'return'
   15 | return 0;
      | ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C

#include<stdio.h>
int main(void) {
int i,j,n;
while(scanf("%d",&n)!=EOF) {
int num[1000000]={0};
for(i=2;i<=n/2;i++) {
for(j=2;j*i<n;j++) {
num[i*j]++;
}
}
for(i=2;i<=n;i++) {
if(num[i]==0) 
printf("%d",i);
} } }
return 0;
}

Compiler output:
main.c:15:1: error: expected identifier or '(' before 'return'
   15 | return 0;
      | ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C

#include <stdio.h>
#include <math.h>
int b[999999];

int prime(int x) {
	for (int i = 2; i < sqrt(x) + 1; i++) {
		if (x%i == 0) {
			return 0;
		}
	}
	return 1;
}
int main(){
	int n;
	b[0] = 0;
	b[1] = 0;
	b[2] = 1;
	int count = 1;
	for (int i = 3; i <= 999999; i++) {
		if (prime(i))count++;
		b[i] = count;
	}
	while (scanf("%d", &n) != EOF){
		printf("%d\n", b[n]);
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccuQaPrn.o: in function `prime':
main.c:(.text+0x4e): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
 
#define MAX(1000001)
 
int prime[MAX];
 
int main()
{
int n, i, j;
     
for (i = 0; i < MAX; i++){
prime[i] = 1;
}
     
prime[0] = prime[1] = 0;
     
for (i = 2; i * i < MAX; i++){
if (prime[i] == 1){
for (j = i * i; j < MAX; j += i){
prime[j] = 0;
}
}
}
     
for (i = 1; i < MAX - 1; i++){
prime[i + 1] += prime[i];
}     
while (scanf("%d", &n) != EOF){
printf("%d\n", prime[n]);
}     
return (0);
}

Compiler output:
main.c:3:13: error: expected parameter name, found "1000001"
    3 | #define MAX(1000001)
      |             ^~~~~~~
main.c:5:11: error: 'MAX' undeclared here (not in a function)
    5 | int prime[MAX];
      |           ^~~
Language: C

#include <stdio.h>
 
#define MAX_SIZE(1000001)
 
int prime[MAX_SIZE];
 
int main()
{
int n, i, j;
     
for (i = 0; i < MAX_SIZE; i++){
prime[i] = 1;
}
     
prime[0] = prime[1] = 0;
     
for (i = 2; i * i < MAX_SIZE; i++){
if (prime[i] == 1){
for (j = i * i; j < MAX_SIZE; j += i){
prime[j] = 0;
}
}
}
     
for (i = 1; i < MAX_SIZE - 1; i++){
prime[i + 1] += prime[i];
}     
while (scanf("%d", &n) != EOF){
printf("%d\n", prime[n]);
}     
return 0;
}

Compiler output:
main.c:3:18: error: expected parameter name, found "1000001"
    3 | #define MAX_SIZE(1000001)
      |                  ^~~~~~~
main.c:5:11: error: 'MAX_SIZE' undeclared here (not in a function)
    5 | int prime[MAX_SIZE];
      |           ^~~~~~~~
Language: C

	int a,b=0,c=0,i,j,l,n,ans[3]={0};
	
	for(a=0;a<=2;a++){
		scanf("%d",&n);
		if(n>=2){
			for(i=2;i<=n;i++){
				for(j=2;j<=i;j++){
					if(i%j==0 && i!=j){
						b++;
					}
				}
				if(b==0){
					ans[a]++;
				}
				else{
					b=0;
				}
			}
			
		}
	
	}
	
	printf("\n%d\n%d\n%d",ans[0],ans[1],ans[2]);

Compiler output:
main.c:3:9: error: expected identifier or '(' before 'for'
    3 |         for(a=0;a<=2;a++){
      |         ^~~
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    3 |         for(a=0;a<=2;a++){
      |                  ^~
main.c:3:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |         for(a=0;a<=2;a++){
      |                       ^~
main.c:24:16: error: expected declaration specifiers or '...' before string constant
   24 |         printf("\n%d\n%d\n%d",ans[0],ans[1],ans[2]);
      |                ^~~~~~~~~~~~~~
main.c:24:31: error: expected declaration specifiers or '...' before 'ans'
   24 |         printf("\n%d\n%d\n%d",ans[0],ans[1],ans[2]);
      |                               ^~~
main.c:24:38: error: expected declaration specifiers or '...' before 'ans'
   24 |         printf("\n%d\n%d\n%d",ans[0],ans[1],ans[2]);
      |                                      ^~~
main.c:24:45: error: expected declaration specifiers or '...' before 'ans'
   24 |         printf("\n%d\n%d\n%d",ans[0],ans[1],ans[2]);
      |                                             ^~~
Language: C

#include <stdio.h>
#include <string.h>


int main()
{
	char inp[96];
	int  n,i,flg,len,ans,k;
	int  dt[100];
	/**--init --**/
	for (;;) {
		gets(inp);
		len = strlen(inp);
		if (len==0) {
			return 1;
		}
		sscanf(inp,"%d",&n);

		/**-- CALC --**/
		ans=0;
		for (i=2 ; i<=n ; i++) {
			flg=0;
			for (k=2 ; k<=i ; k++) {
				if ((i%k)==0) {
//					dt[flg]=i;
					flg++;
				}
			}
			if (flg==1) {
				dt[ans]=i;
				ans++;
			}
		}

		printf("%d\n",ans);
????????????????????????break;
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   12 |                 gets(inp);
      |                 ^~~~
      |                 fgets
main.c:36:1: error: expected expression before '?' token
   36 | ????????????????????????break;
      | ^
Language: C

#include<stdio.h>
#include<math.h>

/*??????????????¨?????¢??°       */
/*????????????0????????\????????¨???*/
void print_rist(bool *rist, int num){
	int i = 2;
	
	while(i <= num) {
		if (rist[i] != 0) {
			printf("%d ", i);
		}
		i++;
	}
	printf("\n");
}


main(){
	bool rist[1000000];
	int i, j,prime;
	unsigned int input_num = 0;
	unsigned int count;
	unsigned int ans;
	
	/*??????????????§????´???°????±???????????????\???*/
	for(j = 0; j < 30; j++) {
		scanf("%d", &input_num);
		if (input_num == 0) {
			break;
		}
		/*??¢?´¢??????????????????*/
		for (i = 1; i <= input_num; i++) {
			rist[i] = 1;
		}	
		rist[i] = 0;
		
		/*?´???°??????????????????*/
		count = 2;
		prime = 0;
		while(count <= sqrt(input_num)) {	/*???input_num??????????????§*/
			i = 2;
			/*count??\??????count????????°??????????????¨???*/
			while((i * count) <= input_num) {
				rist[i * count] = 0;
				i++;
				
			}		
			count++;
			/*?¬????count?????????*/
			while(rist[count] != 1) {
				count++;
			}
			
		}
		
		ans = 0;
		i = 2;
		for (i = 2; i <= input_num; i++) {
			if (rist[i] != 0) {
				ans++;
			}
		}
		printf("%d\n", ans);
		//print_rist(rist, input_num);
	}
}

Compiler output:
main.c:6:17: error: unknown type name 'bool'
    6 | void print_rist(bool *rist, int num){
      |                 ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include<math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:19:1: error: return type defaults to 'int' [-Wimplicit-int]
   19 | main(){
      | ^~~~
main.c: In function 'main':
main.c:20:9: error: unknown type name 'bool'
   20 |         bool rist[1000000];
      |         ^~~~
main.c:20:9: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>
const int MAX_V = 999999;

int main() {
	int i, k, n;
	int prime[MAX_V + 1], cnt[MAX_V + 1];
	for( i = 2; i <= MAX_V; i++) {
		 prime[i] = 1;
	}
	for( i = 2; i * i <= MAX_V; i++) {
		if(prime[i]) {
			for( k = 2 * i; k <= MAX_V; k += i) {
				prime[k] = 0;
			}
		}
	}
	cnt[0] = 0;
	for( i = 0 i <= MAX_V; i++) {
		cnt[i + 1] = cnt[i] + prime[i + 1];
	}
	while(scanf("%d", &n) != EOF) {
		printf("%d\n", cnt[n]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:19: error: expected ';' before 'i'
   18 |         for( i = 0 i <= MAX_V; i++) {
      |                   ^~
      |                   ;
main.c:18:35: error: expected ';' before ')' token
   18 |         for( i = 0 i <= MAX_V; i++) {
      |                                   ^
      |                                   ;
Language: C

#include<stdio.h>
const int MAX_V = 10000;
int main(void){
    int i,k,n;
    int prime[MAX_V+1],sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
    for(i = 2; i < MAX_V; i ++){
        prime[i] = 1;
        cnt[i] ++;
    }
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
                cnt[k] = 0;
            }
        }
    }
    while(scanf("%d",&n) != EOF){
        for(i = 2; i <= n; i ++){
                sum[i+1] = sum[i] + cnt[i];
        }
        printf("%d\n",sum[n+1]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:39: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1],sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
      |                                       ^
main.c:5:56: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1],sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
      |                                                        ^
Language: C

#include<stdio.h>
const int MAX_V = 10000;
int main(void){
    int i,k,n;
    int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
    for(i = 2; i < MAX_V; i ++){
        prime[i] = 1;
        cnt[i] ++;
    }
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
                cnt[k] = 0;
            }
        }
    }
    while(scanf("%d",&n) != EOF){
        for(i = 2; i <= n; i ++){
                sum[i+1] = sum[i] + cnt[i];
        }
        printf("%d\n",sum[n+1]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:26: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
      |                          ^
main.c:5:45: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
      |                                             ^
main.c:5:62: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0},cnt[MAX_V] = {0};
      |                                                              ^
Language: C

#include<stdio.h>
int main(void){
    const int MAX_V = 10000;
    int i,k,n;
    int prime[MAX_V+1],sum[MAX_V+1] = {0};
    for(i = 2; i < MAX_V; i ++){
        prime[i] = 1;
    }
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    for(i = 2; i < MAX_V; i ++){
        sum[i+1] = sum[i] + prime[i];
    }
    while(scanf("%d",&n) != EOF){
        printf("%d\n",sum[n+1]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:39: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1],sum[MAX_V+1] = {0};
      |                                       ^
Language: C

#include<stdio.h>
int main(void){
    const int MAX_V = 10000;
    int i,k,n;
    int prime[MAX_V+1],sum[MAX_V+1] = {0};
    prime[0] = 0;
    prime[1] = 0;
    for(i = 2; i < MAX_V; i ++){
        prime[i] = 1;
    }
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    for(i = 2; i < MAX_V; i ++){
        sum[i+1] = sum[i] + prime[i];
    }
    while(scanf("%d",&n) != EOF){
        printf("%d\n",sum[n+1]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:39: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1],sum[MAX_V+1] = {0};
      |                                       ^
Language: C

#include<stdio.h>
int main(void){
    const int MAX_V = 10000;
    int i,k,n;
    int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0};
    for(i = 2; i < MAX_V; i ++){
        prime[i] = 1;
    }
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    for(i = 2; i < MAX_V; i ++){
        sum[i+1] = sum[i] + prime[i];
    }
    while(scanf("%d",&n) != EOF){
        printf("%d\n",sum[n+1]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:26: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0};
      |                          ^
main.c:5:45: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int prime[MAX_V+1] = {0},sum[MAX_V+1] = {0};
      |                                             ^
Language: C

#include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V+1],sum[MAX_V+1];
int main(void){
    int i,k,n,ans;
    for(i = 0; i < MAX_V + 1; i ++){
        prime[i] = 1;
        sum[i] = 0;
    }
    prime[0] = 0;
    prime[1] = 0;
    for(i = 2; i * i < MAX_V; i ++){
        if(prime[i]){
            for(k = 2 * i; k < MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    for(i = 2; i < MAX_V; i ++){
        sum[i+1] = sum[i] + prime[i];
    }
    while(scanf("%d",&n) != EOF){
        ans = sum[n+1];
        printf("%d\n",ans);
    }
    return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1],sum[MAX_V+1];
      |     ^~~~~
main.c:3:20: error: variably modified 'sum' at file scope
    3 | int prime[MAX_V+1],sum[MAX_V+1];
      |                    ^~~
Language: C

#include <stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V + 1];
int main(){
	//?´???°??¨??????
	int i, k;
	for( i = 2; i <= MAX_V; i++) {
		prime[i] = 1;
	}
	for( i = 2; i * i <= MAX_V; i++){
		if(prime[i]) {
			for( k = 2 * i; k <= MAX_V; k += i){
				prime[k] = 0;
			}
		}
	}
	//?´???????????±???????
	int sum[MAX_V + 2];
	sum[2] = 0;
	for( i = 2; i <= MAX_V; i++){
		sum[i + 1] = sum[i] + prime[i];
	}
	//??\?????¨??????
	int n;
	while(scanf("%d", &n) != EOF){
		printf("%d\n", sum[n + 1]);
	}
	return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V + 1];
      |     ^~~~~
Language: C

#include <stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V+1];
int main(){
	//?´???°??¨??????
	int i, k;
	for( i = 2; i <= MAX_V; i++) {
		prime[i] = 1;
	}
	for( i = 2; i * i <= MAX_V; i++){
		if(prime[i]) {
			for( k = 2 * i; k <= MAX_V; k += i){
				prime[k] = 0;
			}
		}
	}
	//?´???????????±???????
	int sum[MAX_V + 2];
	sum[2] = 0;
	for( i = 2; i <= MAX_V; i++){
		sum[i + 1] = sum[i] + prime[i];
	}
	//??\?????¨??????
	int n;
	while(scanf("%d", &n) != EOF){
		printf("%d\n", sum[n + 1]);
	}
	return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1];
      |     ^~~~~
Language: C

#include <stdio.h>
const int MAX_V = 999999;
int prime[MAX_V+1];
int main(){
	//?´???°??¨??????
	int i, k;
	for( i = 2; i <= MAX_V; i++) {
		prime[i] = 1;
	}
	for( i = 2; i * i <= MAX_V; i++){
		if(prime[i]) {
			for( k = 2 * i; k <= MAX_V; k += i){
				prime[k] = 0;
			}
		}
	}
	//?´???????????±???????
	int sum[MAX_V + 2];
	sum[2] = 0;
	for( i = 2; i <= MAX_V; i++){
		sum[i + 1] = sum[i] + prime[i];
	}
	//??\?????¨??????
	int n;
	while(scanf("%d", &n) != EOF){
		printf("%d\n", sum[n + 1]);
	}
	return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1];
      |     ^~~~~
Language: C

#include <Stdio.h>

int main()
{
    int n,i,j,flag=0,cnt,h,k;
    while(scanf("%d",&n))
    {
        if(n==2)
            printf("1");
        else if(n==3)
            printf("2");
        else
        {
            cnt=2;
            h=n/2;
            for(k=4; k<=n; k++)
            {
                for(j=2; j<=h; j+=2)
              {
                if(k%j==0)
                {
                    flag=1;
                    break;
                }
              }
               if(flag==0)
                cnt++;
               else
               flag=0;
            }
            printf("%d",cnt-1);
        }

    }

    return 0;
}

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

#include <stdio.h>

int prime[999999];

int main() {
  int i, k, n, N = 0;
  for(i = 2; i <= 999999; i++) {
    prime[i] = 1;
  }
  for(i = 2; i*i <= 999999; i++) {
    if(prime[i]) {
      for(k = 2 * i; k <= 999999; k += i) {
        prime[k] = 0;
      }
    }
  }
  for(i = 2; i <= 999999; i++) {
    if(prime[i] == 1){
      N++;
      prime[i] = N;
    }else if(prime[i] == 0){
      prime[i] = N;
  }
  while(scanf("%d", &n) != EOF){
    printf("%d\n", prime[n]);
  }
  return 0;
}

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

#include <cstdio>
#include <cstring>
const int MAX_n = 999999;
bool isPrime[MAX_n+1];
int sum[MAX_n+1];
int main()
{
    memset(isPrime,true,sizeof(isPrime));
    for(int i = 2; 2*i <= MAX_n ; ++i)
        if(isPrime[i])
            for(int j = 2*i; j <= MAX_n; j+=i)
                isPrime[j] = false;
    isPrime[0] = isPrime[1] = false;
    
    for(int i = 0; i < MAX_n; ++i)
        sum[i+1] = sum[i] + isPrime[i+1];
    
    int n;
    while(scanf("%d",&n) != EOF)
    {
        int ans = sum[n];
        printf("%d\n",ans);
    }
    
}

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

#include "stdio.h"
#define MAX_N 999999
bool is_prime[MAX_N+1]; 
int sieve(int n)
{
	int p=0,i;
	for(i=0;i<=n;i++) is_prime[i]=true;
	is_prime[0]=is_prime[1]=false;
	for(i=2;i<=n;i++)
	{
		if(is_prime[i])
		{
			p++;
			for(int j=2*i;j<=n;j+=i) is_prime[j]=false;
		}
	}
	return p;
}
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		printf("%d\n",sieve(n));
	}
	return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'bool'
    3 | bool is_prime[MAX_N+1];
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include "stdio.h"
  +++ |+#include <stdbool.h>
    2 | #define MAX_N 999999
main.c: In function 'sieve':
main.c:7:39: error: 'true' undeclared (first use in this function)
    7 |         for(i=0;i<=n;i++) is_prime[i]=true;
      |                                       ^~~~
main.c:7:39: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:7:39: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:33: error: 'false' undeclared (first use in this function)
    8 |         is_prime[0]=is_prime[1]=false;
      |                                 ^~~~~
main.c:8:33: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>

int prime[2000000];

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

    prime[2] = 1;
    for (i = 3; i < 1000000; i += 2){
        for (j = 3; j * j <= i; j += 2){
            if (i % j == 0){
                break;
            }
        }
        prime[i] = prime[i - 1];
        prime[i + 1] = prime[i - 1];
        if (j * j > i){
            prime[i]++;
            prime[i + 1]++;
        }
    }
    while (~scanf("%d", &n)){
        printf("%d\n", prime[n]);
    }

    return (0);
}
#include <stdio.h>

int prime[2000000];

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

    prime[2] = 1;
    for (i = 3; i < 1000000; i += 2){
        for (j = 3; j * j <= i; j += 2){
            if (i % j == 0){
                break;
            }
        }
        prime[i] = prime[i - 1];
        prime[i + 1] = prime[i - 1];
        if (j * j > i){
            prime[i]++;
            prime[i + 1]++;
        }
    }
    while (~scanf("%d", &n)){
        printf("%d\n", prime[n]);
    }

    return (0);
}

Compiler output:
main.c:34:5: error: redefinition of 'main'
   34 | int main(void)
      |     ^~~~
main.c:5:5: note: previous definition of 'main' with type 'int(void)'
    5 | int main(void)
      |     ^~~~
Language: C

//?´???°????????°????±???????????????°??????
#include <stdio.h>


int main(void)
{
	int num;
	int i, j;
	int flag;
	int count = 0;
	
	scanf("%d", &num);
	
	
	for(i=2; i<=num; i++){
		flag = 0;
		for(j=2; j<num; j++){
			if(i!=j && i%j==0 ){
				flag = 1;
			//	printf("%d %d\n", i, j);
				break;
			}
			
		}
		if(flag == 0) {
		//	printf("i %d\n", i);
			count++;
		}
	}
	
			
	
	printf("%d\n", count);

	return 0;

Compiler output:
main.c: In function 'main':
main.c:35:9: error: expected declaration or statement at end of input
   35 |         return 0;
      |         ^~~~~~
Language: C

#include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>

using namespace std;
int sieve(int n);
int prime[1000000];
bool is_prime[1000000];

int main()
{

	int p = 0;
	for (int i = 0; i <= 999999; i++) {
		is_prime[i] = true;
	}
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i <= 999999; i++) {
		if (is_prime[i]) {
			prime[p++] = i;
			for (int j = 2 * i; j <= 999999; j += i) {
				is_prime[j] = false;
			}
		}
	}
	int n;
	while (scanf_s("%d", &n) != EOF) {
		int i = 0;
		while (prime[i] <= n) {
			i++;
		}
		cout << i << endl;
	}
}

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<math.h>
int prime(int n);

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

	while(scanf("%d",&n)!=EOF)
{

			for(j=1;j<=n;j++)
			{
				store=prime(j);
				if(store==1)
					{
						sum++;
					}

			}
			printf("%d\n",sum);
			sum=0;



}


return 0;

}
int prime(int n)
{


	int i;
	float x,k;
	int l;


	x=float(n);
	k=sqrt(x);

	l=int(k);

		if(n==1 || n==0)
			{
				return 0;
			}


		if(n==2)
			{
				return 1;
			}

	for(i=2;i<=l;i++)
		{
			if(n%i==0)
			{
				return 0;
			}

		}

	return 1;


}

Compiler output:
main.c: In function 'prime':
main.c:42:11: error: expected expression before 'float'
   42 |         x=float(n);
      |           ^~~~~
main.c:45:11: error: expected expression before 'int'
   45 |         l=int(k);
      |           ^~~
Language: C

#include <stdio.h>
#include <math.h>
#define N 1000000
int main(){	
	int i, j, n, answer;
	int a[N];
	for(i=0; i<N; ++i) a[i]=0;
	a[2] = 1;
	for(i=3; i<N; i+=2) a[i]=1;							
	for(i=3; i<=N-1; i+=2){
		if(a[i]==0) continue;
		for(j=i+i; j<N; j+=i) a[j] = 0;				
	}
	while(scanf("%d", &n) != EOF){
		answer = 0;
		for(i=0;i<=n;++i){
			answer+=a[i];
		}
		printf("%d\n", answer);
	}
	return 0
}

Compiler output:
main.c: In function 'main':
main.c:21:17: error: expected ';' before '}' token
   21 |         return 0
      |                 ^
      |                 ;
   22 | }
      | ~
Language: C

/*
Volume0-0009
*/
//#include <iostream>
#include <stdio.h>
#include <stdlib.h>

#define N 1000000
#define TRUE (int)(0==0)
#define FALSE !TRUE
#define BUFLEN 1024
//using std;

int syserr(char *str)
{
  fputs(str, stderr);
  exit(-1);
}
int main(int argc, char *argv[]){
  int f[N];

  memset(f, TRUE, N);
  f[1]=FALSE;
  for (int i=3; i<N; i++){
    if (f[i] == TRUE ) {
      for (int j=i+i; j<N; j+=i){
	f[j] = FALSE;
      }
    }
  }

  for (int i=3; i<N; i+=2) {
    if (f[i/2-1]) {
      x = x + 1;
    }
    f[i/2-1]=x;
  }
  char buf[BUFLEN];
  while (fgets(buf, BUFLEN, stdin) != NULL){
    int n = atoi(buf);

    int m = 0;
    for (int i=1; i<=n; i++){
      if (f[i]){
	m++;
      }
    }

    printf("%d\n", m);
 
  exit(0);
}

Compiler output:
main.c: In function 'main':
main.c:22:3: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   22 |   memset(f, TRUE, N);
      |   ^~~~~~
main.c:7:1: note: include '<string.h>' or provide a declaration of 'memset'
    6 | #include <stdlib.h>
  +++ |+#include <string.h>
    7 | 
main.c:22:3: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
   22 |   memset(f, TRUE, N);
      |   ^~~~~~
main.c:22:3: note: include '<string.h>' or provide a declaration of 'memset'
main.c:34:7: error: 'x' undeclared (first use in this function)
   34 |       x = x + 1;
      |       ^
main.c:34:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:52:1: error: expected declaration or statement at end of input
   52 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
int x,i,t=0;
while(scanf("%d",&x)!=EOF){
for(i=2;i*i<x){
if(x%i==0)
break;
t++;
}
printf("%d",t);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected ';' before ')' token
    5 | for(i=2;i*i<x){
      |              ^
      |              ;
Language: C

#include <stdio.h>

int main(void){

   int n;
   int a,b;
   int cnt1,cnt2;
   
   while(1){
       n=-1;
       cnt1=0;
       cnt2=0;
       scanf("%d", &n);
       if(n==-1)break;
       
       if(n==1){
           puts("0");
           continue;
       }
       if(n==2){
           puts("1");
           continue;
       }
       
       for(a=3; a<=n; a++){
           for(b=1; b<=a; b++){
               if(n % a == 0)cnt++;
           }
           if(cnt1 == 2)cnt2++;
       }
       printf("%d\n", cnt2);
   }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:30: error: 'cnt' undeclared (first use in this function); did you mean 'cnt2'?
   27 |                if(n % a == 0)cnt++;
      |                              ^~~
      |                              cnt2
main.c:27:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<Math.h>

int main(){
	int n;
	int a[30][10000];
	int b;
	int i, j, p;
	int c[30];
	p = 0;
	while (scanf("%d", &n) != EOF){
		b = (int)pow((double)n, 0.5);
		c[p] = 0;
		a[p][0] = -1;
		for (i = 2; i <= b; i++){
			for (j = 2; j <= n / i; j++){
				a[p][i*j - 1] = -1;
			}
		}
		for (i = 1; i <= n; i++){
			if (a[p][i - 1] != -1){ c[p]++; }
		}
		p++;
	}
	for (i = 0; i < p; i++){
		printf("%d",c[i]);
	}
	return 0;
}

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

#include<stdio.h>
#include<Math.h>

int main(){
	int n;
	int a[10000];
	int b;
	int i, j, p;
	int c[30];
	p = 0;
	while (scanf("%d", &n) != EOF){
		b = (int)pow((double)n, 0.5);
		c[p] = 0;
		a[0] = -1;
		for (i = 2; i <= b; i++){
			for (j = 2; j <= n / i; j++){
				a[i*j - 1] = -1;
			}
		}
		for (i = 1; i <= n; i++){
			if (a[i - 1] != -1){ c[p]++; }
			a[i - 1] = 0;
		}
		p++;
	}
	for (i = 0; i < p; i++){
		printf("%d\n", c[i]);
	}
	scanf("%d", &n);
	return 0;
}

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

#include<stdio.h>
#include<Math.h>

int main(){
	int n;
	int a[10000];
	int b;
	int i, j, p;
	int c[30];
	p = 0;
	while (scanf("%d", &n) != EOF){
		b = (int)pow((double)n, 0.5);
		c[p] = 0;
		a[0] = -1;
		for (i = 2; i <= b; i++){
			for (j = 2; j <= n / i; j++){
				a[i*j - 1] = -1;
			}
		}
		for (i = 1; i <= n; i++){
			if (a[i - 1] != -1){ c[p]++; }
			a[i - 1] = 0;
		}
		p++;
	}
	for (i = 0; i < p; i++){
		printf("%d\n", c[i]);
	}
	return 0;
}

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

#include<stdio.h>

int prime_elements[1000001]={0};

int main(void){
    int i,j,result,num_input;
    for(i=2;i<=1000000;i++){
        if(prime_elements[i]==0){
            for(j=2;i*j<=1000000;j++){
                prime_elements[i*j]=1;
            }
        }
    }
    while(scanf("%d",&num_input)!=EOF){
        result=0;
        for(i=2;i<=input;i++){
            if(prime_elements[i]==0){
               result++;
            }
        }
    printf("%d\n",result);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:20: error: 'input' undeclared (first use in this function); did you mean 'int'?
   16 |         for(i=2;i<=input;i++){
      |                    ^~~~~
      |                    int
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C


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

bool is_prime_num(int n) {
	if (n < 2) {
		return false;
	} else if (n == 2) {
		return true;
	} else if (n % 2 == 0) {
		return false;
	}
	
	for (int i = 3; i <= (int)sqrt(n); i+=2) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}

int count_prime_num(int n) {
	int acc = 0;
	for (int i = 2; i <= n; i++) {
		if (is_prime_num(i)) {
			acc++;
		}
	}
	return acc;
}

int main() {
	char line[256];
	if (fgets(line, 256, stdin)) {
		printf("%d\n", count_prime_num(atoi(line)));
	}
}

Compiler output:
/usr/bin/ld: /tmp/ccpoGAXe.o: in function `is_prime_num':
main.c:(.text+0x6b): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<math.h>
int isprime(int x){
	int i;
	if(x==2)
		return 1;
	if(x<2 || x%2 == 0)
		return 0;
	for(i=3;i<=sqrt(double(x));i+=2)
		if(x%i == 0)
			return 0;
	return 1;
}
int main(){
	int count = 0;
	int i,n;
	double a;
	while(scanf("%d",&n) != EOF){
		for(i=1;i<=n;i++)
			count += isprime(i);
		printf("%d\n",count);
		count = 0;
	}
	return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:9:25: error: expected expression before 'double'
    9 |         for(i=3;i<=sqrt(double(x));i+=2)
      |                         ^~~~~~
Language: C

#include<stdio.h>
#include<math.h>
int isprime(int x){
	int i;
	double a = sqrt(double(x));
	if(x==2)
		return 1;
	if(x<2 || x%2 == 0)
		return 0;
	for(i=3;i<=int(a);i+=2)
		if(x%i == 0)
			return 0;
	return 1;
}
int main(){
	int count = 0;
	int i,n;
	double a;
	while(scanf("%d",&n) != EOF){
		for(i=1;i<=n;i++)
			count += isprime(i);
		printf("%d\n",count);
		count = 0;
	}
	return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:5:25: error: expected expression before 'double'
    5 |         double a = sqrt(double(x));
      |                         ^~~~~~
main.c:10:20: error: expected expression before 'int'
   10 |         for(i=3;i<=int(a);i+=2)
      |                    ^~~
Language: C

#include<stdio.h>
#include<math.h>
int isprime(int x){
	int i;
	if(x==2)
		return 1;
	if(x<2 || x%2 == 0)
		return 0;
	for(i=3;i<=sqrt(double(x));i+=2)
		if(x%i == 0)
			return 0;
	return 1;
}
int main(){
	int count = 0;
	int i,n;
	while(scanf("%d",&n) != EOF){
		for(i=1;i<=n;i++)
			count += isprime(i);
		printf("%d\n",count);
		count = 0;
	}
	return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:9:25: error: expected expression before 'double'
    9 |         for(i=3;i<=sqrt(double(x));i+=2)
      |                         ^~~~~~
Language: C

#include <stdio.h>
 
int main()
{
  int n, i, j;
  int ans;
  char era[1000000];
 
  while(scanf("%d", &n) != EOF){
 
    era[i] = {1};
 
    ans=0;
 
    for(i=2; i<=n; i++){
      if(era[i] == 1){
        ans++;
        for(j=i; j<=n; j+=i) era[j]=0;
      }
    }
 
    printf("%d\n", ans);
  }
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:14: error: expected expression before '{' token
   11 |     era[i] = {1};
      |              ^
Language: C

#include <stdio.h>
 
int main()
{
  int n, i, j;
  int ans;
  char era[1000000];
 
  while(scanf("%d", &n) != EOF){
 
    era[] = {1};
 
    ans=0;
 
    for(i=2; i<=n; i++){
      if(era[i] == 1){
        ans++;
        for(j=i; j<=n; j+=i) era[j]=0;
      }
    }
 
    printf("%d\n", ans);
  }
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected expression before ']' token
   11 |     era[] = {1};
      |         ^
Language: C

#include<stdio.h>
   
int main(){
   
int n,i,wareta;

wareta = 0;
 
while(scanf("%d\n", &n) != EOF){
 
  for(i=2,i<n;i++){
    if(n%i == 0){wareta=wareta+1;}  

  } 

printf("%d\n", sprintf(hoge, "%d", a+b));
 
 
}
   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:18: error: expected ';' before ')' token
   11 |   for(i=2,i<n;i++){
      |                  ^
      |                  ;
main.c:16:24: error: 'hoge' undeclared (first use in this function)
   16 | printf("%d\n", sprintf(hoge, "%d", a+b));
      |                        ^~~~
main.c:16:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:36: error: 'a' undeclared (first use in this function)
   16 | printf("%d\n", sprintf(hoge, "%d", a+b));
      |                                    ^
main.c:16:38: error: 'b' undeclared (first use in this function)
   16 | printf("%d\n", sprintf(hoge, "%d", a+b));
      |                                      ^
Language: C

#include<stdio.h>
   
int main(){
   
int n,i,cnt=0,sw=1,sosuu[1000000],t;
 
while(scanf("%d\n", &n) != EOF){

  if(n>1){
    sosuu[cnt]=2
    cnt++;  
    for(i=3;i<=n;i+=2){
      sw=1;
      for(t=0;t<cnt&&sosuu[t]*sosuu[t]<=i;t++){
        if(i%sosuu[t] == 0){
          sw=0;
          break;
        }  
      }
      if(sw==1){
         sosuu[cnt]=i;
         cnt++;
      }
   }
   else{cnt=0;} 

  } 

printf("%d\n", cnt);
 
 
}
   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:17: error: expected ';' before 'cnt'
   10 |     sosuu[cnt]=2
      |                 ^
      |                 ;
   11 |     cnt++;
      |     ~~~          
main.c:25:4: error: expected '}' before 'else'
   25 |    else{cnt=0;}
      |    ^~~~
main.c: At top level:
main.c:34:5: error: expected identifier or '(' before 'return'
   34 |     return 0;
      |     ^~~~~~
main.c:35:1: error: expected identifier or '(' before '}' token
   35 | }
      | ^
Language: C

#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
    long long a,b,ans;
    int t;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%lld%lld",&a,&b);
        ans=(b-a+1)*(a+b)/2-a-a+2;
        printf("%lld\n",ans);
    }
}

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

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

ll a[1000000],p[1000000];

ll sieve( ll n)
{
    ll i,j,k=0,m;

    a[0]=1;
    a[1]=1;
    p[k++]=2;

    m=sqrt(n);

    for(i=4; i<=n; i+=2)
        a[i]=1;

    for(i=3; i<=m; i+=2)
        if(a[i]==0)
            for(j=i*i; j<=n; j+=i*2)
                a[j]=1;

    for(i=3; i<=n; i+=2)
        if(a[i]==0)
            p[k++]=i;
    return k;
}

int main()
{
    ll n,i,sz;
    while(cin>>n)
    {
        sz = sieve(n);
        cout<<sz<<'\n';
    }

    return 0;
}

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

#include <stdio.h>

int is_prime(int);

int main()
{
	int input_count;
	int prime_count;
	int input;
	int for_cnt;
	int output_array[30];
	
	for(for_cnt = 0; for_cnt < 30; for_cnt++)
	{ac
		output_array[for_cnt] = 0;
	}
	
	
	input_count = 0;
	
	while(input_count < 30)
	{
		scanf("%d", &input);
		
		if(input > 999999 || input < 1)		/*Check input validity*/
		{
			printf("Invlaid input (1-999999)\n");
			continue;
		}
		
		prime_count = 0;
		for(for_cnt = 2; for_cnt <= input; for_cnt++)
		{
			if(is_prime(for_cnt))
			{
				prime_count++;
			}
		}
		
		output_array[input_count] = prime_count;
		input_count++;
	}
	output_array[input_count] = -1;		/*For end tag*/
	
	input_count = 0;
	
	while(output_array[input_count] != -1)
	{
		printf("%d\n", output_array[input_count]);
		input_count++;
	}
		
    return 0;
}

int is_prime(int test_num)
{
	int divisor = 2;	/*Least prime number*/
	for( ; divisor < test_num; ++divisor)
	{
		if(test_num % divisor == 0)
		{
			return 0
		}
	}
	return 1;
}

Compiler output:
main.c: In function 'main':
main.c:14:10: error: unknown type name 'ac'
   14 |         {ac
      |          ^~
main.c:15:41: error: variable-sized object may not be initialized except with an empty initializer
   15 |                 output_array[for_cnt] = 0;
      |                                         ^
main.c: In function 'is_prime':
main.c:63:33: error: expected ';' before '}' token
   63 |                         return 0
      |                                 ^
      |                                 ;
   64 |                 }
      |                 ~
Language: C

#include <stdio.h>

int is_prime(int);

int main()
{
	int input_count;
	int prime_count;
	int input;
	int for_cnt;
	int output_array[30];
	
	for(for_cnt = 0; for_cnt < 30; for_cnt++)
	{
		output_array[for_cnt] = 0;
	}
	
	
	input_count = 0;
	
	while(input_count < 30)
	{
		scanf("%d", &input);
		
		if(input > 999999 || input < 1)		/*Check input validity*/
		{
			printf("Invlaid input (1-999999)\n");
			continue;
		}
		
		prime_count = 0;
		for(for_cnt = 2; for_cnt <= input; for_cnt++)
		{
			if(is_prime(for_cnt))
			{
				prime_count++;
			}
		}
		
		output_array[input_count] = prime_count;
		input_count++;
	}
	
	if(input_count < 30)
	{
		output_array[input_count] = -1;		/*For end tag*/
	}
	
	input_count = 0;
	
	while(input_count < 30 && output_array[input_count] != -1)
	{
		printf("%d\n", output_array[input_count]);
		input_count++;
	}
		
	
    return 0;
}

BOOL is_prime(int test_num)
{
	int divisor = 2;	/*Least prime number*/
	for( ; divisor < test_num; ++divisor)
	{
		if(test_num % divisor == 0)
		{
			return 0;
		}
	}
	return 1;
}

Compiler output:
main.c:61:1: error: unknown type name 'BOOL'
   61 | BOOL is_prime(int test_num)
      | ^~~~
Language: C

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

typedef int 	BOOL;
#define TRUE	1;
#define FALSE	0;

int is_prime(int);

int main()
{
	int input_count;
	int prime_count;
	int input;
	int for_cnt;
	int output_array[30];
	
	for(for_cnt = 0; for_cnt < 30; for_cnt++)
	{
		output_array[for_cnt] = 0;
	}
	
	
	input_count = 0;
	
	
	do
	{
		scanf("%d", &input);
		
		
		prime_count = 0;
		for(for_cnt = 2; for_cnt <= input; for_cnt++)
		{
			if(is_prime(for_cnt))
			{
				prime_count++;
			}
		}
		
		output_array[input_count] = prime_count;
		input_count++;
	}
	while(input_count < 30 && input != 0)
	
	if(input_count < 30)
	{
		output_array[input_count] = -1;		/*For end tag*/
	}
	
	input_count = 0;
	
	while(input_count < 30 && output_array[input_count] != -1)
	{
		printf("%d\n", output_array[input_count]);
		input_count++;
	}
		
	
    return 0;
}

BOOL is_prime(int test_num)
{
	int divisor = 2;	/*Least prime number*/
	for( ; divisor < test_num; ++divisor)
	{
		if(test_num % divisor == 0)
		{
			return FALSE;
		}
	}
	return TRUE;
}

Compiler output:
main.c: In function 'main':
main.c:44:46: error: expected ';' before 'if'
   44 |         while(input_count < 30 && input != 0)
      |                                              ^
      |                                              ;
   45 | 
   46 |         if(input_count < 30)
      |         ~~