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

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

int is_prime(int test_num)
{
	int divisor;
	
	if(test_num == 1)
	{
		return 0;
	}
	else if(test_num == 2 || test_num == 3 || test_num == 5 || test_num == 7)
	{
		return 1;
	}
	else if((test_num % 2) == 0)
	{
		return 0;
	}

	for(divisor = 3 ; divisor <= (sqrt(test_num) + 1); divisor += 2)
	{
		if(test_num % divisor == 0)
		{
			return 0;
		}
	}
	
	return 1;
}

int main()
{
	int input_count;
	int prime_count;
	int input;
	int for_cnt;
	int output[30];
	
	
	input_count = 0;
	
	while(scanf("%d", &input) != EOF && input_count < 30)
	{
		prime_count = 0;
		
		if(input >= 2)
		{
			prime_count++;
		}
		for_cnt = 3;
		while(for_cnt <= input)
		{
			if(is_prime(for_cnt))
			{
				prime_count++;
			}
			for_cnt += 2;
		}
		output[input_count] = prime_count;
		input_count++;
	}
	
	for(for_cnt = 0; for_cnt < input_count; for_cnt++)
	{
		printf("%d\n", output[for_cnt]);
	}

	
    return 0;
}

int is_prime(int test_num)
{
	int divisor;
	
	if(test_num == 1)
	{
		return 0;
	}
	else if(test_num == 2 || test_num == 3 || test_num == 5 || test_num == 7)
	{
		return 1;
	}
	else if((test_num % 2) == 0)
	{
		return 0;
	}

	for(divisor = 3 ; divisor <= (sqrt(test_num) + 1); divisor += 2)
	{
		if(divisor % 3 == 0)
		{
			continue;
		}
		if(divisor % 5 == 0)
		{
			continue;
		}
		if(divisor % 7 == 0)
		{
			continue;
		}
		
		if(test_num % divisor == 0)
		{
			return 0;
		}
	}
	
	return 1;
}

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

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

int is_prime1(int);
int is_prime2(int);

int prime[168];

int main()
{
	int input, input_count, prime_count, cnt;
	int output[30];
	
	/*Make prime table*/
	prime[0] = 2;
	prime_cnt = 1;
	for(cnt = 3; cnt < 1000; cnt += 2)
	{
		if(is_prime1(cnt))
		{
			prime[prime_cnt] = cnt;
			prime_cnt++;
		}
	}
	
	/*Get, calculate input then save in output[]*/
	input_count = 0;
	while(scanf("%d", &input) != EOF)
	{
		prime_count = 0;
		if(input >= 2)
		{
			prime_count++;
		}
		for(cnt = 3; cnt <= input; cnt += 2)
		{
			if(is_prime2(cnt))
			{
				prime_count++;
			}
		}
		output[input_count] = prime_count;
		input_count++;
	}
	
	/*print output[]*/
	for(cnt = 0; cnt < input_count; cnt++)
	{
		printf("%d\n", output[cnt]);
	}
	
    return 0;
}

/*Test prime directly*/
int is_prime1(int prime1_input)
{
	int prime1_cnt;
	
	if(prime1_input == 1)
	{
		return 0;
	}
	else if(prime1_input == 2 || prime1_input == 3 || prime1_input == 5 || prime1_input == 7)
	{
		return 1;
	}
	else if((prime1_input % 2) == 0)
	{
		return 0;
	}

	for(prime1_cnt = 3 ; prime1_cnt <= (sqrt(prime1_input)); prime1_cnt += 2)
	{
		if(prime1_input % prime1_cnt == 0)
		{
			return 0;
		}
	}
	
	return 1;
}

/*Test prime with prime table*/
int is_prime2(int prime2_input)
{
	int prime2_cnt = 0;
	for( ;prime2_cnt <168; prime2_cnt++)
	{
		if(prime[prime2_cnt] > sqrt(prime2_input))
		{
			break;
		}
		if(prime2_input % prime[prime2_cnt] == 0)
		{
			return 0;
		}
	}
	return 1;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:6:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while'
    6 |          while( scanf("%d", &n) > 0){
      |          ^~~~~
main.c:13:26: error: 'num' undeclared (first use in this function)
   13 |                          num++;
      |                          ^~~
main.c:13:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

  scanf("%d",n);

  for(i=n;i>2;i--){
       for(j=2;j<(n-1);j++){
                   k=n%j;
                   if(K==0){return 0;}
                   else{if(j==n-2){l=l+1;}}
                }
         }
    printf("%d",l);
}        
  

Compiler output:
main.c: In function 'main':
main.c:11:23: error: 'K' undeclared (first use in this function)
   11 |                    if(K==0){return 0;}
      |                       ^
main.c:11:23: 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, j, k,l;
  l=0;

  scanf("%d",n);

  for(i=n;i>2;i--){
       for(j=2;j<(n-1);j++){
                   k=n%j;
                   if(K==0){return 0;}
                   else{if(j==n-2){l=l+1;}}
                }
         }
    printf("%d",l);
}        
  

Compiler output:
main.c: In function 'main':
main.c:11:23: error: 'K' undeclared (first use in this function)
   11 |                    if(K==0){return 0;}
      |                       ^
main.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int IsPrimeNum(int i){
  int j;
  if(i==1){
    return 0;
  }else if(i==2){
    return 1;
  }

  if(i%2==0){
    return 0;
  }

  for(j=3; j<=i/j; j++){
    if(i%j==0){
      return 0;
    }
  }
  return 1;
}
int primeNum(int n){
  int cout = 0, i;
  for(i=1; i<=n; i++){
    if(IsPrimeNum(i)){
      cout += 1;
    }
  }
  return cout;
}

int main(){
  int n;
  int list[50];
  int j = 0;
  while(scanf("%d", &n) != EOF){
    list[j] = primeNum(n);
    j += 1;
  }
  int i;
  for(i=0; i<j; j++)
    printf("%d\n", list[iOA]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:42:25: error: 'iOA' undeclared (first use in this function)
   42 |     printf("%d\n", list[iOA]);
      |                         ^~~
main.c:42:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int primeNum(int n){
  int cout = 0, i;
  for(i=1; i<=n; i++){
    if(IsPrimeNum(i)){
      cout += 1;
    }
  }
  return cout;
}

int main(){
  int n;
  int list[50];
  int j = 0;
  while(scanf("%d", &n) != EOF){
    list[j] = primeNum(n);
    j += 1;
  }
  int i;
  for(i=0; i<j; i++)
    printf("%d\n", list[i]);
  return 0;
}

Compiler output:
main.c: In function 'primeNum':
main.c:4:8: error: implicit declaration of function 'IsPrimeNum'; did you mean 'primeNum'? [-Wimplicit-function-declaration]
    4 |     if(IsPrimeNum(i)){
      |        ^~~~~~~~~~
      |        primeNum
main.c: In function 'main':
main.c:15:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   15 |   while(scanf("%d", &n) != EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int primeNum(int n){
main.c:15:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   15 |   while(scanf("%d", &n) != EOF){
      |         ^~~~~
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:28: error: 'EOF' undeclared (first use in this function)
   15 |   while(scanf("%d", &n) != EOF){
      |                            ^~~
main.c:15:28: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:15:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |     printf("%d\n", list[i]);
      |     ^~~~~~
main.c:21:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <cmath>
//?找第K小的除数
int main()
{
    long long  n;
    int k;
    scanf("%lld%d",&n,&k);
    long long  d=0,m=0;//第1小是除数是1
    int flag=0;
    int i=1;
    int b=sqrt(n);
    for(;i<=b;i++)
    {
        if(n%i==0)//i是n除数
        {
            d=i;
            m++;
        }
        if(m==k)
        {
            printf("%lld\n",d);
            flag=1;
            break;
        }
        if(m>k)
            break;
    }
    if(flag==0)
        printf("-1\n");

    return 0;
}

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

#include<cstdio>
#include<iostream>
#define M 31
int prime(int n);
int main(void)
{
	int i,j,t=0,a[M],b[M]={0}; 
	while(scanf("%d",&a[t]))
	   t++;
    for(i=0;i<t;i++)
      for(j=2;j<=a[t];j++)
          b[i]+=prime(j);
	for(i=0;i<t;i++)
	    printf("%d\n",b[i]);
    return 0;
 } 	
 int prime(int n)
 {
 	int l;
 	if(n==2)
 	  return 1;
 	for(l=2;l<n;l++)
	    if(n%l==0)
	      return 0;
	return 1;
 }
 				

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

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

typedef long long ll;

bool prime(ll n)
{
	ll i;
	int flag=0;
	if(n==2)
		return true;
		
	else if(n<2)
	{
		return false;
	}
	
	else
	{
/*		if((int)sqrt(n)==sqrt(n))
		{
			for(i=2;i<(int)sqrt(n)+1&&flag==0;i++)
			{
				if(n%i==0)
				{
					return false;
					flag=1;
				}	

			}
		
			if(flag==0)
				return true;
		}
		
		else
		{
			for(i=2;i<(int)sqrt(n)+1&&flag==0;i++)
			{
				if(n%i==0)
				{
					return false;
					flag=1;
				}	

			}
		
			if(flag==0)
				return true;
		}*/
		for(i=2;i<(int)sqrt(n)+1&&flag==0;i++)
		{
			if(n%i==0)
			{
				return false;
				flag=1;
			}	

		}
		
		if(flag==0)
			return true;
	}
}

int main()
{
	ll n;
	ll i;
	
/*	while(scanf("%lld",&n)!=EOF)
	{
		printf("%d\n",prime(n));
	}*/
	
	
	while(scanf("%lld",&n)!=EOF)
	{
		ll j=0;
		for(i=2;i<n+1;i++)
		{
			if(prime(i))
				j++;
		}
		
		printf("%lld\n",j);
	}
	

	return 0;
}

Compiler output:
main.c:7:1: error: unknown type name 'bool'
    7 | bool prime(ll n)
      | ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    3 | #include<math.h>
  +++ |+#include <stdbool.h>
    4 | 
main.c: In function 'prime':
main.c:12:24: error: 'true' undeclared (first use in this function)
   12 |                 return true;
      |                        ^~~~
main.c:12:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:12:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:24: error: 'false' undeclared (first use in this function)
   16 |                 return false;
      |                        ^~~~~
main.c:16:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<cstdio>
#include<cmath>
#define SIZE 1000000
#define sizE 600000

int prime[sizE], nprime=0;
int mark[SIZE];

void sieve()
{
    int i,j, limit=sqrt(SIZE*1.0)+2;

    mark[0]=1;
    mark[1]=1;

    for(i=4; i<=SIZE; i+=2)
        mark[i]=1;

    prime[nprime]=2;

    for(i=3; i<=SIZE; i+=2)
    {
           if(!mark[i])
            {
            prime[++nprime] = i;

            if(i<=limit)
            {
                for(j=i*i; j<=SIZE; j+=i*2)
                mark[j]=1;
            }
        }
    }

}

int main()
{
    int n;

    sieve();

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

        while(prime[i++]<=n)
            k++;

        printf("%d\n", k);
    }

    return 0;
}

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

#include<iostream>
using namespace std;
const long N = 1000000;
long prime[N] = {0},num_prime;
int isNotPrime[N] = {1, 1};
int main()
{
    int n;
    while(cin >> n)
    {
        num_prime = 0;
        for(long i = 2 ; i <= n ; i ++)
        {
            if(! isNotPrime[i])
                prime[num_prime ++]=i;

            for(long j = 0 ; j < num_prime && i * prime[j] <=  n ; j ++)
            {
                isNotPrime[i * prime[j]] = 1;
                if( !(i % prime[j] ) )
                    break;
            }
        }
        cout<< num_prime << endl;
    }
    return 0;
}

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

#include<stdio.h>
int main(){
   int i,k;
       scanf("%d",&i);
      for(int j=2; j<i; j++){
         k=i%j
    if(k==0){
continue;
   }else{
        
}
}

}

Compiler output:
main.c: In function 'main':
main.c:6:15: error: expected ';' before 'if'
    6 |          k=i%j
      |               ^
      |               ;
    7 |     if(k==0){
      |     ~~
Language: C

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<cmath>
#include<vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;

#define pi acos(-1.0)
#define eps 1e-10
#define pf printf
#define sf scanf
#define lson rt<<1,l,m
#define rson rt<<1|1,m+1,r
#define e tree[rt]
#define _s second
#define _f first
#define all(x) (x).begin,(x).end
#define mem(i,a) memset(i,a,sizeof i)
#define for0(i,a) for(int (i)=0;(i)<(a);(i)++)
#define for1(i,a) for(int (i)=1;(i)<=(a);(i)++)
#define mi ((l+r)>>1)
#define sqr(x) ((x)*(x))

const int inf=0x3f3f3f3f;
const int Max=1e6+1;
bool vis[Max+1];
int p[Max/3],m,num[Max+1];

void prime()
{
    mem(vis,0);
    p[0]=0;
    vis[1]=1;
    for(int i=2;i<=Max;i++)
    {
        if(!vis[i])p[++p[0]]=i;
        for(int j=1;j<=p[0]&&(ll)i*p[j]<=Max;j++)
        {
            vis[i*p[j]]=1;
            if(!(i%p[j]))break;
        }
    }
    num[0]=0;
    for(int i=1;i<=Max;i++)
        num[i]=!vis[i]?num[i-1]+1:num[i-1];
}

int main()
{
    prime();
    while(~sf("%d",&m))
        pf("%d\n",num[m]);
    return 0;
}

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

#include <stdlib.h>
#include <stdio.h>
#include <stdbool>
#include <math.h>
#define N 999999
bool prime_num [N + 1] = { 0 };

void select_prime_num()
{
	for (int i = 2; i <= N; i++)
	{
		if (!prime_num [i]) 
			continue;
		for(int j = 2;  i * j <= N; j++)
			prime_num [i * j] = 0;
	}
}

int main()
{
	for (int i = 0; i <= N; i++)
		prime_num [i] = 1;
	select_prime_num();
	
	int n;
	while (scanf("%d", &n) == 1)
	{
		int num = 0;
		for (int i = 2; i <= n; i++)
		{
			if (prime_num [i])
				num++;
		}
		printf("%d\n", num);
	}
	
	return 0;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:4:26: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    4 |    scanf(scanf("%d", &n) != EOF);
      |                          ^
      |                          |
      |                          int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c: At top level:
main.c:18:4: error: expected identifier or '(' before 'return'
   18 |    return 0;
      |    ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
??????int s[10000], l, m, n, i, k, sum;
??????sum = 0;
??????for ( k = 2; k <= 10; k++ ){
????????????if (s[k] != 1 ) {
??????????????????for ( l = 1; l <= 10 / k; l++ ) {
????????????????????????s[k * l] = 1;
??????????????????}
????????????}
??????}
??????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ??????int s[10000], l, m, n, i, k, sum;
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ??????sum = 0;
      | ^
main.c:4:7: error: 'sum' undeclared (first use in this function)
    4 | ??????sum = 0;
      |       ^~~
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:1: error: expected expression before '?' token
    5 | ??????for ( k = 2; k <= 10; k++ ){
      | ^
Language: C

include<stdio.h>
int main(){

        int i,n,j;
        int k=0;
        int count=0;
        int a[50];
        int l=0;

        while(scanf("%d",&n)!=EOF){
                for(j=2;j<=n;j++){
                        for(i=2;i<j;i++){
                                if((j%i)==0) break;
                                k++;
                        }
                if(k==j-2) count++;
                k=0;
                }
                a[l]=count;
                l++;
                count=0;
        }

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

        return 0;
}

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

#include<stdio.h>
cost int MAX_V = 1000000;
int prime[MAX_V+1]
int main(){
  int i, k, n, count = 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;
      }
    }
  }
  while(scanf("%d", &n) != EOF){
    for(i = 0;i <= n;i++){
      if(prime[i] == 1){
        count++;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}

Compiler output:
main.c:2:5: error: expected ';' before 'int'
    2 | cost int MAX_V = 1000000;
      |     ^~~~
      |     ;
main.c:3:19: error: expected ';' before 'int'
    3 | int prime[MAX_V+1]
      |                   ^
      |                   ;
    4 | int main(){
      | ~~~                
main.c: In function 'main':
main.c:7:5: error: 'prime' undeclared (first use in this function)
    7 |     prime[i] = 1;
      |     ^~~~~
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V+1];
int main(){
  int i, k, n, count = 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;
      }
    }
  }
  while(scanf("%d", &n) != EOF){
    for(i = 0;i <= n;i++){
      if(prime[i] == 1){
        count++;
      }
    }
    printf("%d\n", count);
  }
  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 sum[31];

int main() {
	int n,i,k,ans;
	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;
			}
		}
	}
	while(scanf("%d", &n) != EOF) {
		for(i=0;i<=n;i++) {
			sum[i+1]=sum[i]+prime[i];
		}
		ans=sum[n+1];
		printf("%d?????§????´???°?????°???%d???\n",n,ans);
	}
	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 sum[31];

int main() {
	int n,i,k,ans;
	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;
			}
		}
	}
	while(scanf("%d", &n) != EOF) {
		for(i=0;i<=n;i++) {
			sum[i+1]=sum[i]+prime[i];
		}
		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];
      |     ^~~~~
Language: C

#include<stdio.h>
int prime[1000001];
int sum[31];

int main() {
	int n,i,k,ans;
	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;
			}
		}
	}
	while(scanf("%d", &n) != EOF) {
		for(i=0;i<=n;i++) {
			sum[i+1]=sum[i]+prime[i];
		}
		ans=sum[n+1];
		printf("%d\n",ans);
	}
	return 0; 
}

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

#include<stdio.h>
const int MAX_V=1000000;
int prime[MAX_V];
int sum[MAX+1];

int main() {
	int n,i,k,ans;
	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;
			}
		}
	}
	while(scanf("%d", &n) != EOF) {
		for(i=0;i<=n;i++) {
			sum[i+1]=sum[i]+prime[i];
		}
		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];
      |     ^~~~~
main.c:4:9: error: 'MAX' undeclared here (not in a function); did you mean 'MAX_V'?
    4 | int sum[MAX+1];
      |         ^~~
      |         MAX_V
Language: C

#include<stdio.h>
int main() {
	int n,i,k,ans;
	const int MAX_V=1000000;
	int prime[MAX_V];
	int sum[MAX+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;
			}
		}
	}
	while(scanf("%d", &n) != EOF) {
		for(i=0;i<=n;i++) {
			sum[i+1]=sum[i]+prime[i];
		}
		ans=sum[n+1];
		printf("%d\n",ans);
	}
	return 0; 
}

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

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

Compiler output:
main.c:4:5: error: variably modified 'prime' at file scope
    4 | 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, v;
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;
   }
 }
}
while(scanf("%d",&v)!=EOF) {
	int cnt = 0;
    for(i=2; i<=v; i++){
	if(prime[i]==1){
		cnt++;
	}
}
printf("%d\n",cnt);
}
}

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

#include <stdio.h>
#include <ctype.h>
const int MAX_V = 1000000;
int prime[MAX_V+1];
int main() {
int i, k, v;
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;
   }
 }
}
while(scanf("%d",&v)!=EOF) {
	int cnt = 0;
    for(i=2; i<=v; i++){
	if(prime[i]==1){
		cnt++;
	}
}
printf("%d\n",cnt);
}
}

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

#include<stdio.h>
int isprime(int n) {
	for(int i=2;i*i<=n;i++) {
		if(n%i==0) return 0;
	}
	return 1;
}

int main() {
	int n,p1,q1;
	while(1) {
		scanf("%d", &n);
		if(n==0) break;
		for(i=3;i<=n-2;i+=2) {
			if(isprime(i)==1 && isprime(i+2)==1) {
				if(i+2>big) {
					p1=i; q1=i+2;
				}
			}
		}
		printf("%d %d\n",p1,q1);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:21: error: 'i' undeclared (first use in this function)
   14 |                 for(i=3;i<=n-2;i+=2) {
      |                     ^
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:40: error: 'big' undeclared (first use in this function)
   16 |                                 if(i+2>big) {
      |                                        ^~~
Language: C

#include<stdio.h>
int isprime(int n) {
	for(int i=2;i*i<=n;i++) {
		if(n%i==0) return 0;
	}
	return 1;
}

int main() {
	int n,p1,q1,i;
	while(1) {
		scanf("%d", &n);
		if(n==0) break;
		for(i=3;i<=n-2;i+=2) {
			if(isprime(i)==1 && isprime(i+2)==1) {
				if(i+2>big) {
					p1=i; q1=i+2;
				}
			}
		}
		printf("%d %d\n",p1,q1);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:40: error: 'big' undeclared (first use in this function)
   16 |                                 if(i+2>big) {
      |                                        ^~~
main.c:16:40: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

    return 0; 
    
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1]; // 1????´???°???0????´???°??§??????
      |     ^~~~~
main.c:4:5: error: variably modified 'pcount' at file scope
    4 | int pcount[MAX_V+1];
      |     ^~~~~~
Language: C

#include <stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V]; 
int pcount[MAX_V];
int main() {
    int i, k,a,sum=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;
            }
            
        } 
        
    }
    pcount[0]=0;
    pcount[1]=0;
    for(i=2;i<MAX_V;i++){
        if(prime[i]){
            sum++;
        }
        pcount[i]=sum;
    }
    for(i=0;i<30;i++){
        scanf("%d",&a);
        printf("%d\n",pcount[a]);
    } 

    return 0; 
    
}

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

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

    return 0; 
    
}

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

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

    return 0; 
    
}

Compiler output:
main.c:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1]; // 1????´???°???0????´???°??§??????
      |     ^~~~~
main.c:4:5: error: variably modified 'pcount' at file scope
    4 | int pcount[MAX_V];
      |     ^~~~~~
Language: C

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

    return 0; 
    
}

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

#include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V + 1];
int sum[MAX_V + 1];
int main(){
  int n, 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;
      }
    }
  }
  sum[0] = 0;
  for(i = 0;i < MAX_V;i++){
    sum[i+1] = sum[i]+prime[i+1];
  }
  while(scanf("%d", &n) != EOF){
    printf("%d\n", sum[n]);
  }
  return 0;
}

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

#include<stdio.h>
int MAX_V = 10000;
int prime[MAX_V + 1];
int sum[MAX_V + 1];
int main(){
  int n, 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;
      }
    }
  }
  sum[0] = 0;
  for(i = 0;i < MAX_V;i++){
    sum[i+1] = sum[i]+prime[i+1];
  }
  while(scanf("%d", &n) != EOF){
    printf("%d\n", sum[n]);
  }
  return 0;
}

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

#include <stdio.h>

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

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

#include <stdio.h>

const int MAX_V = 999999;
    int prime[MAX_V+1];
    int sum[MAX_V+1];

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

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

#include<stdio.h>

const int MAX_V = 100000;
int prime[100001];

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

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

#include<stdio.h>

const int MAX_V = 100000;
int prime[100001];

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

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

#include<stdio.h>
#define MAX_V 10000;
int prime[MAX_V + 1];
int sum[MAX_V + 1];
int main(){
  int n, 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;
      }
    }
  }
  sum[0] = 0;
  for(i = 0;i < MAX_V;i++){
    sum[i+1] = sum[i]+prime[i+1];
  }
  while(scanf("%d", &n) != EOF){
    printf("%d\n", sum[n]);
  }
  return 0;
}

Compiler output:
main.c:2:20: error: expected ']' before ';' token
    2 | #define MAX_V 10000;
      |                    ^
main.c:3:11: note: in expansion of macro 'MAX_V'
    3 | int prime[MAX_V + 1];
      |           ^~~~~
main.c:2:20: error: expected ']' before ';' token
    2 | #define MAX_V 10000;
      |                    ^
main.c:4:9: note: in expansion of macro 'MAX_V'
    4 | int sum[MAX_V + 1];
      |         ^~~~~
main.c: In function 'main':
main.c:7:23: error: expected expression before ';' token
    7 |   for(i = 2;i <= MAX_V;i++){
      |                       ^
main.c:8:5: error: 'prime' undeclared (first use in this function)
    8 |     prime[i] = 1;
      |     ^~~~~
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:21: error: expected expression before ';' token
   10 |   for(i=2;i*i<=MAX_V;i++){
      |                     ^
main.c:12:29: error: expected expression before ';' token
   12 |       for(k = 2*i;k <= MAX_V;k += i){
      |                             ^
main.c:17:3: error: 'sum' undeclared (first use in this function)
   17 |   sum[0] = 0;
      |   ^~~
main.c:18:22: error: expected expression before ';' token
   18 |   for(i = 0;i < MAX_V;i++){
      |                      ^
Language: C

#include <stdio.h>
const int MAX_V = 999999;
int prime[MAX_V+1]={0};
int sum[MAX_V+2]={0};
int main(){
int i, k, v ,n;
  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=0 ;i<=MAX_V+1 ;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:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1]={0};
      |     ^~~~~
main.c:4:5: error: variably modified 'sum' at file scope
    4 | int sum[MAX_V+2]={0};
      |     ^~~
Language: C

#include <stdio.h>
const int MAX_V = 999999;
int prime[MAX_V+1];
int sum[MAX_V+2;
int main(){
int i, k, v ,n;
  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=0 ;i<=MAX_V+1 ;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:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1];
      |     ^~~~~
main.c:4:16: error: expected ']' before ';' token
    4 | int sum[MAX_V+2;
      |                ^
      |                ]
Language: C

#include<stdio.h>
const int MAX_V=1000000;
int prime[MAX_V+1];
int sum[MAX_V+2];
int main(){
  int i,k,n;
  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=0;i<MAX_V+1;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:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX_V+1];
      |     ^~~~~
main.c:4:5: error: variably modified 'sum' at file scope
    4 | int sum[MAX_V+2];
      |     ^~~
Language: C

#include <stdio.h>
const int MAX_V = 999999;
int prime[MAX_V+1]={0};
int sum[MAX_V+2]={0};
int main(){
int i, k, v ,n;
  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=0 ;i<=MAX_V+1 ;i++){
    sum[i+1] += sum[i] + prime[i];
  }

  while(scanf("%d" ,&n)){
    if(n==0)break;
     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]={0};
      |     ^~~~~
main.c:4:5: error: variably modified 'sum' at file scope
    4 | int sum[MAX_V+2]={0};
      |     ^~~
Language: C

#include <stdio.h>
const int MAX_V = 999999;
int main(){
int prime[MAX_V+1]={0};
int sum[MAX_V+2]={0};
int i, k, v ,n;
  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=0 ;i<=MAX_V+1 ;i++){
    sum[i+1] += sum[i] + prime[i];
  }

  while(scanf("%d" ,&n)){
    if(n==0)break;
     printf("%d\n" ,sum[n+1]);
  }
  return 0;
}

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

#include <stdio.h>
const int MAX = 100000;
int prime[MAX+1];
int sum[MAX+2];

int main() {
    int n, i, k;
    for(i = 2; i <= MAX; i++) {
        prime[i] = 1;
    }
    for(i = 2; i <= MAX; i++) {
        if(prime[i]) {
            for(k = 2*i; k <= MAX; k+=i) {
                prime[k] = 0;
            }
        }
    }
    sum[0] = 0;
    for(i = 0; i <= MAX+1; 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:3:5: error: variably modified 'prime' at file scope
    3 | int prime[MAX+1];
      |     ^~~~~
main.c:4:5: error: variably modified 'sum' at file scope
    4 | int sum[MAX+2];
      |     ^~~
Language: C

#include <stdio.h>
const int MAX = 100000;

int main() {
    int n, i, k;
    int prime[MAX+1] = {0};
    int sum[MAX+2] = {0};
    for(i = 2; i <= MAX; i++) {
        prime[i] = 1;
    }
    for(i = 2; i <= MAX; i++) {
        if(prime[i]) {
            for(k = 2*i; k <= MAX; k+=i) {
                prime[k] = 0;
            }
        }
    }
    for(i = 0; i <= MAX+1; 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:6:24: error: variable-sized object may not be initialized except with an empty initializer
    6 |     int prime[MAX+1] = {0};
      |                        ^
main.c:7:22: error: variable-sized object may not be initialized except with an empty initializer
    7 |     int sum[MAX+2] = {0};
      |                      ^
Language: C

#include <stdio.h>
const int MAX = 100000;

int main() {
    int n, i, k;
    int prime[MAX+1] = {0};
    int sum[MAX+2] = {0};
    for(i = 2; i <= MAX; i++) {
        prime[i] = 1;
    }
    for(i = 2; i <= MAX; i++) {
        if(prime[i]) {
            for(k = 2*i; k <= MAX; k+=i) {
                prime[k] = 0;
            }
        }
    }
    for(i = 0; i < MAX+1; 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:6:24: error: variable-sized object may not be initialized except with an empty initializer
    6 |     int prime[MAX+1] = {0};
      |                        ^
main.c:7:22: error: variable-sized object may not be initialized except with an empty initializer
    7 |     int sum[MAX+2] = {0};
      |                      ^
Language: C

#include <stdio.h>

const int MAX_V = 10000;
int prime[MAX_V+1];
int main(){
    int i, k, v;
    for(i = 2; i <= MAX_V; i++) prime[i] = 1;
    for(i = 2; i <= MAX_V; i++){
        if(prime[i]){
            for(k = 2 * i; k <= MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    while(scanf("%d", &v) != EOF) {
        for(i = v; i >= 5; i--){
            if(prime[i] && prime[i-2]) {
                printf("%d %d\n", i-2, i);
                break;
            }
        }
    }
}

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

#include <stdio.h>

int main(){
　　const int MAX_V = 10000;
　　int prime[MAX_V+1];
    int i, k, v;
    for(i = 2; i <= MAX_V; i++) prime[i] = 1;
    for(i = 2; i <= MAX_V; i++){
        if(prime[i]){
            for(k = 2 * i; k <= MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }
    while(scanf("%d", &v) != EOF) {
        for(i = v; i >= 5; i--){
            if(prime[i] && prime[i-2]) {
                printf("%d %d\n", i-2, i);
                break;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: stray '\343' in program
    4 | <U+3000><U+3000>const int MAX_V = 10000;
      | ^~~~~~~~
main.c:4:3: error: stray '\343' in program
    4 | <U+3000><U+3000>const int MAX_V = 10000;
      |         ^~~~~~~~
main.c:5:1: error: stray '\343' in program
    5 | <U+3000><U+3000>int prime[MAX_V+1];
      | ^~~~~~~~
main.c:5:3: error: stray '\343' in program
    5 | <U+3000><U+3000>int prime[MAX_V+1];
      |         ^~~~~~~~
Language: C

#include <stdio.h>

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

Compiler output:
main.c:4:5: error: variably modified 'prime' at file scope
    4 | int prime[MAX_V+1];//1?´???°,0?´???°??§??????
      |     ^~~~~
main.c:5:5: error: variably modified 'sum' at file scope
    5 | int sum[MAX_V+1];
      |     ^~~
Language: C

#include <stdio.h>

const int MAX_V = 10000;
int prime[MAX_V+1];

void init(){
    int i, k, v;
    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 isprime(int n){
    return prime[n];
}

int main(){
    init();
    int num;
    while(1){
        int count=0;
        scanf("%d", &num);
        for(int i=2; i<=num; i++){
            if(isprime(i)==1)
                count++;
        }
    printf("%d\n", count);
    }
    return 0;
}

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

#include <stdio.h>

const int MAX_V = 100000;
int prime[MAX_V+1];

void init(){
    int i, k, v;
    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 isprime(int n){
    return prime[n];
}

int main(){
    init();
    int num;
    while(scanf("%d", &num) != EOF){
        int count=0;
        for(int i=2; i<=num; i++){
            if(isprime(i)==1)
                count++;
        }
    printf("%d\n", count);
    }
    return 0;
}

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