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

#include <stdio.h>

int main()
{
    double total = 0;
    double n;
    scanf("%d", &n);
    int a[n];
    int pre;
    for (pre = 0; pre < n; pre++)
    {
        scanf("%d", &a[pre]);
    }
    for (pre = 0; pre < n; pre++)
    {
        int b;
        int can = 0;
        for (b = 2; b < a[pre]; b++)
        {
            if (a[pre] % b == 0)
            {
                can++;
            }
        }
        if (can == 0)
        {
            total++;
        }
    }
    printf("%d\n", total);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: size of array 'a' has non-integer type
    8 |     int a[n];
      |         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main() {
    int i,hantei_sosu=0,count=0,n,sosu,j;
    
    scanf("%d",&n);
    
    sosu = malloc(n * sizeof (int));
    
    for(i=0;i<n;i++){
        scanf("%d",&sosu[i]);
    }
    
    for(i=0;i<n;i++){
        for(j=1;j<=sosu[i];j++){
            if(sosu[i] % j == 0) hantei_sosu++; 
        }
        if(hantei_sosu == 2) count++;
        hantei_sosu = 0;
    }
    
    printf("%d\n",count);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:10: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
    8 |     sosu = malloc(n * sizeof (int));
      |          ^
main.c:11:25: error: subscripted value is neither array nor pointer nor vector
   11 |         scanf("%d",&sosu[i]);
      |                         ^
main.c:15:24: error: subscripted value is neither array nor pointer nor vector
   15 |         for(j=1;j<=sosu[i];j++){
      |                        ^
main.c:16:20: error: subscripted value is neither array nor pointer nor vector
   16 |             if(sosu[i] % j == 0) hantei_sosu++;
      |                    ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main() {
  int i,hantei_sosu=0,count=0,n;
    double *sosu,z;
    scanf("%d",&n);
    
    sosu = (double *)malloc(n * sizeof (double));
    
    for(i=0;i<n;i++){
        scanf("%f",&sosu[i]);
    }
    
    for(i=0;i<n;i++){
        for(z=1;z<=sosu[i];z++){
            if(sosu[i] % z == 0) hantei_sosu++; 
        }
        if(hantei_sosu == 2) count++;
        hantei_sosu = 0;
    }
    
    printf("%d",count);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:16:24: error: invalid operands to binary % (have 'double' and 'double')
   16 |             if(sosu[i] % z == 0) hantei_sosu++;
      |                ~~~~~~~ ^
      |                    |
      |                    double
Language: C

#include"stdio.h"
#include"stdlib.h"
#include"math.h"

int cls(int);
int main()
{
    int n;
    int p;
    int i;
    int num=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&p);
        if(cls(p)==1)num++;
    }
    printf("%d",num)
    return 0;
}

int cls(int n)
{
    int num=(int)sqrt(n);
    int i;
    for(i=2;i<num;i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}


Compiler output:
main.c: In function 'main':
main.c:18:21: error: expected ';' before 'return'
   18 |     printf("%d",num)
      |                     ^
      |                     ;
   19 |     return 0;
      |     ~~~~~~
Language: C

include <stdio.h>
int main(){
  int n;
  int number[10000];
  int i;
  int j;
  int count=0;

  scanf("%d",&n);

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

  for(i=0;i<n;i++){
    for(j=2;j<number[i];j++){
      if(number[i] % j == 0) break;
      if(j == number[i]-1) count++;
    }
  }

  printf("%d\n",count);

  return 0;
}



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

  #include<stdio.h>

  int main(){

    int n,i,temp,k;
    int pc,count; //Prime count
    scanf("%d",&n);
    pc=2;
    for(i=1;i<=n;i++){
      while(1){
        for(j=1;j<=pc;j++){
          if((pc%j)==0){
              count++;
          }
        }
        if(count==2){
          temp=pc;
          pc++;
          break;
        }
        else{
          pc++;
        }
      }
      printf("%d\n",&temp);
    }
        return 0;
  }



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

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



Compiler output:
main.c: In function 'main':
main.c:7:17: error: expected expression before '<' token
    7 |     for(j=num;1=<j;i--){
      |                 ^
main.c: At top level:
main.c:14:3: error: expected identifier or '(' before 'return'
   14 |   return 0;
      |   ^~~~~~
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(int argc, char argv[]){
  FIlE *fp;
  int a,cnt=0,i,j;
  int *num;
  fp=fopen(argv[1],"w");
  fscanf(fp,"%d",&a);
  num = (int *)malloc(a * sizeof(int));
  for(i=0;i<a;i++){
    fscanf(fp,"%d",&num[i]);
    for(j=num[i]-1;1<=j;j--){
      if(j==1)cnt++;
      if(num[i]%j==0)break;
  }
}
  printf("%d\n",cnt);
  free(num);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:4:3: error: unknown type name 'FIlE'; did you mean 'FILE'?
    4 |   FIlE *fp;
      |   ^~~~
      |   FILE
main.c:7:16: error: passing argument 1 of 'fopen' makes pointer from integer without a cast [-Wint-conversion]
    7 |   fp=fopen(argv[1],"w");
      |            ~~~~^~~
      |                |
      |                char
In file included from main.c:1:
/usr/include/stdio.h:264:44: note: expected 'const char * restrict' but argument is of type 'char'
  264 | extern FILE *fopen (const char *__restrict __filename,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
main.c:7:5: error: assignment to 'int *' from incompatible pointer type 'FILE *' [-Wincompatible-pointer-types]
    7 |   fp=fopen(argv[1],"w");
      |     ^
main.c:8:10: error: passing argument 1 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
    8 |   fscanf(fp,"%d",&a);
      |          ^~
      |          |
      |          int *
/usr/include/stdio.h:422:37: note: expected 'FILE *' but argument is of type 'int *'
  422 | extern int fscanf (FILE *__restrict __stream,
      |                    ~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:11:12: error: passing argument 1 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   11 |     fscanf(fp,"%d",&num[i]);
      |            ^~
      |            |
      |            int *
/usr/include/stdio.h:422:37: note: expected 'FILE *' but argument is of type 'int *'
  422 | extern int fscanf (FILE *__restrict __stream,
      |                    ~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include<stdio.h>
int main(){
    int n;
    int i;
    int j;
    int number[10000];
    int count = 0;
    
    scanf("%d",&n);
    
    for(i = 0;i<n;i++){
        scanf("%d",&number[i]);
    if(number[i] == 2) count++;
    else if(number[i] % j == 0) break;
    else if(number[i] - 1 == j) count++; break;
    else continue;
    }
    printf("%d\n",count);
    return 0
    
}



Compiler output:
main.c: In function 'main':
main.c:16:5: error: 'else' without a previous 'if'
   16 |     else continue;
      |     ^~~~
main.c:19:13: error: expected ';' before '}' token
   19 |     return 0
      |             ^
      |             ;
   20 | 
   21 | }
      | ~
Language: C

#include<stdio.h>
int main(){
    int n;
    int i;
    int j;
    int number[10000];
    int count = 0;
    
    scanf("%d",&n);
    
    for(i = 0;i<n;i++){
        scanf("%d",&number[i]);
    if(number[i] == 2) count++;
    else if(number[i] % j == 0) break;
    else if(number[i] - 1 == j) count++; break;
    else continue;
    }
    printf("%d\n",count);
    return 0;
    
}



Compiler output:
main.c: In function 'main':
main.c:16:5: error: 'else' without a previous 'if'
   16 |     else continue;
      |     ^~~~
Language: C

#include<stdio.h>
int main(){
int check(int); 
 int n;
 int number[10000];
 int i;
 int count=0;
 
 scanf("%d",&n);
 
 for(i=0;i<n;i++){
     scanf("%d",&number[i]);
     if(check(number[i]) == 1) count++;
      }
 }
 printf("%d\n",count);
 return 0;
}

int check(int x){
    int i;
    if(x == 2) return 1;
    for(i=2;i<x-1;i++){
    if(x % i == 0) return 0;
    else if(i == x - 1) return 1;
    }
}



Compiler output:
main.c:16:9: error: expected declaration specifiers or '...' before string constant
   16 |  printf("%d\n",count);
      |         ^~~~~~
main.c:16:16: error: unknown type name 'count'
   16 |  printf("%d\n",count);
      |                ^~~~~
main.c:17:2: error: expected identifier or '(' before 'return'
   17 |  return 0;
      |  ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include<stdio.h>
int main(){
int check(int); 
 int n;
 int number[10000];
 int i;
 int count=0;
 
 scanf("%d",&n);
 
 for(i=0;i<n;i++){
     scanf("%d",&number[i]);
     if(check(number[i]) == 1) count++;
      }
 }
 printf("%d\n",count);
 return 0;
}

int check(int x){
    int i;
    if(x == 2) return 1;
    for(i=2;i<x;i++){
    if(x % i == 0) return 0;
    else if(i == x - 1) return 1;
    }
}



Compiler output:
main.c:16:9: error: expected declaration specifiers or '...' before string constant
   16 |  printf("%d\n",count);
      |         ^~~~~~
main.c:16:16: error: unknown type name 'count'
   16 |  printf("%d\n",count);
      |                ^~~~~
main.c:17:2: error: expected identifier or '(' before 'return'
   17 |  return 0;
      |  ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>
int main(){
int check(int); 
 int n;
 int number[10000];
 int i;
 int count=0;
 
 scanf("%d",&n);
 
 for(i=0;i<n;i++){
     scanf("%d",&number[i]);
     if(check(number[i]) == 1) count++;
      }
 printf("%d\n",count);
 return 0;
}

int check(int x){
    double i = 3.0;
    if(x == 2) return 1;
    if(x % 2 == 0) return 0;
    while(i <= sqrt(x)){
    if(x % i == 0) return 0;
    i += 2;
    }
    return 1;
}



Compiler output:
main.c: In function 'check':
main.c:25:10: error: invalid operands to binary % (have 'int' and 'double')
   25 |     if(x % i == 0) return 0;
      |          ^
Language: C

include<stdio.h>
int main()
{
  int n,i,k,a,b,in=0,p;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    if(a==2)in++;
    for(k=3;k<=a;k+=2){
      p=k-2;
      if(a==2){in++; break;}
      if(a==3){in++; break;}
      if(a!=2 && a%2==0)break;
      if(a!=3 && a%3==0)break;
      if(a!=5 && a%5==0)break;
      if(a!=7 && a%7==0)break;
      if((a%k)==0 && (a/k)!=1){
        break;
      }
      if(k>a/2){
        in++;
        break;
      }
      if(a%k==0 && a/k==1){in++; break;}
      if(a==3 || a==5 || a==7){in++; break;}
    }
  }
  printf("%d\n",in);
  return 0;
}


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

include<stdio.h>
int main()
{
  int n,i,k,a,b,in=0,p;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    if(a==2){in++;}
    for(k=3;k<=a;k+=2){
      p=k-2;
      if(a==2){in++; break;}
      if(a==3){in++; break;}
      if(a!=2 && a%2==0)break;
      if(a!=3 && a%3==0)break;
      if(a!=5 && a%5==0)break;
      if(a!=7 && a%7==0)break;
      if((a%k)==0 && (a/k)!=1){
        break;
      }
      if(k>a/2){
        in++;
        break;
      }
      if(a%k==0 && a/k==1){in++; break;}
      if(a==3 || a==5 || a==7){in++; break;}
    }
  }
  printf("%d\n",in);
  return 0;
}


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

#include<stdio.h>
#include<stdlib.h>
int main(void){
int N;
int n,i,j;
int S=0,c=0;
while(1){
scanf("%d",&n);
if(n>=1 && n<=10000)break;
}
for(i=0 ; i<n ; i++){
  while(1){
  scanf("%d",&N);
  if(N>=2 && N<=100000000)break;
  }
  if(N==2){S++; continue;}
  if(N%2==0)continue;
  for(j=3 ; j<N[i] ; j+=2){
    if(N[i]%j==0){c=1; break;}
  }
  if(c==0){
  S++;
  }
  c=0;
}
printf("%d\n",S);
free(N);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:16: error: subscripted value is neither array nor pointer nor vector
   18 |   for(j=3 ; j<N[i] ; j+=2){
      |                ^
main.c:19:9: error: subscripted value is neither array nor pointer nor vector
   19 |     if(N[i]%j==0){c=1; break;}
      |         ^
main.c:27:6: error: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion]
   27 | free(N);
      |      ^
      |      |
      |      int
In file included from main.c:2:
/usr/include/stdlib.h:687:25: note: expected 'void *' but argument is of type 'int'
  687 | extern void free (void *__ptr) __THROW;
      |                   ~~~~~~^~~~~
Language: C

#include<stdio.h>
int Sosu(int N){
  if(N==2)return 1;
  if(N%2==0)return 0;;
  for(j=3 ; j<N ; j+=2){
    if(N%j==0)return 0;
  }
  return 1;
}
int main(void){
int N;
int n,i,j;
int S=0,c=0;
while(1){
scanf("%d",&n);
if(n>=1 && n<=10000)break;
}
for(i=0 ; i<n ; i++){
  while(1){
  scanf("%d",&N);
  if(N>=2 && N<=100000000)break;
  }
  S+=Sosu(N);
}
printf("%d\n",S);
return 0;
}


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

#include <stdio.h>
#include<stdlib.h>
int main()
{
  int i,j,n,x＝０;

  /* 自然数 */
  int *number;

  /* 判定フラグ */
  int flag = 0;
  scanf("%d",&n);
  number = (int *)malloc(sizeof(int) * n);

  /* 自然数の入力 */
  for(i=0;i<n;i++){
  scanf("%d", &number[i]);
}

  /* 素数かどうかを判定 */
  for(i=0;i<n;i++){
    flag = 0;
  for( j=2;j<number[i];++j) {
    if( number[i]%j==0 ) {
      flag = 1;
      break;
    }
  }
  if(flag==0){
    x++;
  }
}

  /* 判定結果を出力 */
printf("%d\n",x);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:30:5: error: 'x' undeclared (first use in this function)
   30 |     x++;
      |     ^
main.c:30:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main() {
	int n = 0, a[10000], i, j, count = 0, flag = 0;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d",&a[i]);
	}

	for (i = 0; i < n; i++) {
		if (a[i]==2) {
			count++;
		}
		else {
			for (j = 2; j < a[i]; j++) {
				if (a[i]%j==0) {
					flag = 1;
					break;
				}
			}
			if (flag==0) {
				count++;
			}
		}
		flag = 0;
	}

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


Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
#include<stdlib.h>
int main() {
int a[10000]
    int n,i,q,j,t,p=0,u=0,o=0;
  scanf("%d",&n);
  if(n<1 || 10000<n) exit(0);
  for(i=0;i<n;i++) {
    scanf("%d",&q);
    a[i]=q;
    if(q<2 || 100000000<q) exit(0);

    p=1;
    for(j=2;j<q;j++) {
    t=a[i]%j;
    if(q!=2 && t==0) {p=0; break;}
    }
    if(p==1)
    o++;
  }
    printf("%d\n",o);
    return 0;
  }
  



Compiler output:
main.c: In function 'main':
main.c:4:13: error: expected ';' before 'int'
    4 | int a[10000]
      |             ^
      |             ;
    5 |     int n,i,q,j,t,p=0,u=0,o=0;
      |     ~~~      
main.c:10:5: error: 'a' undeclared (first use in this function)
   10 |     a[i]=q;
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 10000

int prime(int num,int n){
  int j;
    
    if(num<2)
      return 0;
    else if(num==2)
      return 1;

    if(num%2 == 0)
      return 0;

    for(j=3;j<=num/i;i+=2){
      if(n%i == 0)
	return 0;
    }
    return 1;



}


int main(void){

  int i, n=0;
  int num[N],A=0;

  scanf("%d",&n );

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

  printf("%d\n",A);

  return 0;
}




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

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
  int a[10000];
    int n,i,q,j,t,p=0,u=0,o=0;
  scanf("%d",&n);
  if(n<1 || 10000<n) exit(0);
  for(i=0;i<n;i++) {
    scanf("%d",&q);
    a[i]=q;
    if(q<2 || 100000000<q) exit(0);

    p=0;
    if(a[i]==2 && a[[i]==3){ o++; continue;}
   if(a[i]%2==0) continue;
    for(j=3;j<sqrt(a[i]);j+=2) {
    t=a[i]%j;
    if(t==0) p++; 
    }
    if(p==1)
    o++;
  }
    printf("%d\n",o);
    return 0;
  }
  


Compiler output:
main.c: In function 'main':
main.c:15:21: error: expected expression before '[' token
   15 |     if(a[i]==2 && a[[i]==3){ o++; continue;}
      |                     ^
Language: C

#include <stdio.h>
#include <math.h>
int main(){
    int i, j;
    int n, temp;
    int count = 0;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%d", &temp);
        for(j = 2; j <= sqrt(tmep); j++){
            if (temp%j == 0) break;
        }
        if (j>sqrt(tmp) || sqrt(tmp)<2){
count++; 
        }
}
    printf("%d\n", count);
return 0; }


Compiler output:
main.c: In function 'main':
main.c:10:30: error: 'tmep' undeclared (first use in this function); did you mean 'temp'?
   10 |         for(j = 2; j <= sqrt(tmep); j++){
      |                              ^~~~
      |                              temp
main.c:10:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:20: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
   13 |         if (j>sqrt(tmp) || sqrt(tmp)<2){
      |                    ^~~
      |                    temp
Language: C

#include <stdio.h>
#include <math.h>
int main(){
    int i, j;
    int n, temp;
    int count = 0;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%d", &temp);
        for(j = 2; j <= sqrt(tmep); j++){
            if (temp%j == 0) break;
        }
        if (j>sqrt(tmp) || sqrt(tmp)<2){
count++; 
        }
}
    printf("%d\n", count);
return 0; }



Compiler output:
main.c: In function 'main':
main.c:10:30: error: 'tmep' undeclared (first use in this function); did you mean 'temp'?
   10 |         for(j = 2; j <= sqrt(tmep); j++){
      |                              ^~~~
      |                              temp
main.c:10:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:20: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
   13 |         if (j>sqrt(tmp) || sqrt(tmp)<2){
      |                    ^~~
      |                    temp
Language: C

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


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

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



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

#include<stdio.h>
#include<math.h>
#define NMAX 10000
#define NMIN 1
#define MAX 100000000
#define MIN 2
int main(){
  int i,n,j,num[N],count=0;
  scanf("%d",&n);
  if(n>NMAX||n<NMIN) return 0;
  for(i=n;i>0;i--){
    scanf("%d",&num[i]);
    if(num[i]>=MIN&&num[i]<=MAX){
      if(num[i]!=2&&num[i]%2==0) count++;
      else{
	for(j=3;j<=sqrt(num[i]);j+=2){
	  if(num[i]%j==0){
	    count++;
	    break;
	  }
	}
      }
    }
    else break;
  }
  printf("%d\n",n-count);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:8:17: error: 'N' undeclared (first use in this function)
    8 |   int i,n,j,num[N],count=0;
      |                 ^
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
#include <strlib.h>
void judgment(int*,int);
int main(){
  int C[N],i,k,judge;
  scanf("%d",&k);
  if(k<1 || k>10000)exit(8);
  for(i=0;i<k;i++){
    scanf("%d",&C[i]);
    if(C[i]<2 || C[i]>1000000000)exit(9);
  }
    judgment(C,k);
  return 0;
}
void judgment(int *c,int n){
  int i,j,max=0,cnt=0,flag=0;
  double num;
  for(i=0;i<n;i++){
    if(*(c+i)>max){
      max=*(c+i);
    }
  }

for(i=2;i<=max;i++){
if(i==2){cnt++;continue;}
 else if(i%2==0)continue;
 num = sqrt(i);
 for(j=3;j<=num;j+=2){
   if(i%j==0){flag=1;break;}
 }
 if(flag==0)cnt++;
 flag=0;

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




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

#include<stdio.h>
#define N 10000
int main()
{
    int n,i,j,cnt,sosuu=0;
    
    while(1)
    {
        scanf("%d",&n);
        if(n>=1 && n <= N) break;
    }
    
    for(i=0;i<n;i++)
    {
        while(1)
        {
            scanf("%d",&num);
            if(num >= 2 && num <= 100000000) break;
        }
        
        cnt = 0;
        for(j=1;j<num;j++)
        {
            if(num%j = 0) cnt++;
        }
        if(cnt == 1) sosuu++;
    }
    
    printf("%d\n",sosuu);
    return 0;
}
        }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:17:25: error: 'num' undeclared (first use in this function)
   17 |             scanf("%d",&num);
      |                         ^~~
main.c:17:25: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:32:9: error: expected identifier or '(' before '}' token
   32 |         }
      |         ^
main.c:33:9: error: expected identifier or '(' before '}' token
   33 |         }
      |         ^
main.c:34:5: error: expected identifier or '(' before '}' token
   34 |     }
      |     ^
main.c:35:1: error: expected identifier or '(' before '}' token
   35 | }
      | ^
Language: C

#include<stdio.h>
#define N 10000
int main()
{
    int n,i,j,cnt,sosuu=0;
    
    while(1)
    {
        scanf("%d",&n);
        if(n>=1 && n <= N) break;
    }
    
    for(i=0;i<n;i++)
    {
        while(1)
        {
            scanf("%d",&num);
            if(num >= 2 && num <= 100000000) break;
        }
        
        cnt = 0;
        for(j=1;j<num;j++)
        {
            if(num%j = 0) cnt++;
        }
        if(cnt == 1) sosuu++;
    }
    
    printf("%d\n",sosuu);
    return 0;
}
     


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

#include <stdio.h>
int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 2 ; j < sqart(x[i]); j++){
              if(x[i] % j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}




Compiler output:
main.c: In function 'main':
main.c:14:27: error: implicit declaration of function 'sqart' [-Wimplicit-function-declaration]
   14 |           for(j = 2 ; j < sqart(x[i]); j++){
      |                           ^~~~~
Language: C

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

int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 2 ; j < sqart(x[i]); j++){
              if(x[i] % j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}




Compiler output:
main.c: In function 'main':
main.c:16:27: error: implicit declaration of function 'sqart'; did you mean 'sqrt'? [-Wimplicit-function-declaration]
   16 |           for(j = 2 ; j < sqart(x[i]); j++){
      |                           ^~~~~
      |                           sqrt
Language: C

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

int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 2 ; j < sqrt(x[i]); j++){
              if(sqrt(x[i] )% j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}




Compiler output:
main.c: In function 'main':
main.c:17:29: error: invalid operands to binary % (have 'double' and 'int')
   17 |               if(sqrt(x[i] )% j == 0){
      |                  ~~~~~~~~~~~^
      |                  |
      |                  double
Language: C

#include <stdio.h>
int main(){
  int A[10000],i,y,count=0,a,j;

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

  for(a=0;a<i+1;a++){
       y=0;
       for(j=2;j<A[a];j++){
             if(A[a]%j==0)  {
                 y++;
                 break;
                             }
        }
       
       if(yakusuu==0) count++;
    }
  
  printf("%d\n",count);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:18:11: error: 'yakusuu' undeclared (first use in this function)
   18 |        if(yakusuu==0) count++;
      |           ^~~~~~~
main.c:18:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main() {
	int n, A[10000];
	int i,j,ct=0;
	int flag=0;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &A[i]);
	}
	
 for (i = 0; i < n; i++) {
	 flag = 0;
	 else for (j = 2; j < A[i]; j+=2) {
		 if (A[i] % j == 0) {
			 flag = 1;
			 break;
		 }
	 }
	 if (flag == 0)ct++;
}	
   printf("%d\n", ct);
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:10: error: 'else' without a previous 'if'
   13 |          else for (j = 2; j < A[i]; j+=2) {
      |          ^~~~
Language: C

#include <stdio.h>
#include <math.h>
int judge(int);
int main(){
  int A[10000],i,n,cnt=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    }
  for(i=0;i<n;i++){
    if (judge(A[i])==3)cnt++;
    }
  printf("%d\n",cnt);
  return 0;
}

int judge(int x){
  int i;
  if(x==2)return true;
  if(x<2)return 1;
  if(x%2==0)return 1;
  
  for(i=3;i< (double)sqrt(x);i+=2){
    if(x%i==0)return 1;
  }
  return 3;
}



Compiler output:
main.c: In function 'judge':
main.c:19:18: error: 'true' undeclared (first use in this function)
   19 |   if(x==2)return true;
      |                  ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | int judge(int);
main.c:19:18: note: each undeclared identifier is reported only once for each function it appears in
   19 |   if(x==2)return true;
      |                  ^~~~
Language: C

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#define NMini 1
#define NMaxes 10000
#define Mini 2
#define Maxes 100000000
int main(){
  int i,j,N,num[NMaxes],count=0;
  scanf("%d",&N);

  if(N>NMaxes || N<NMini) exit(1);

  for(i=N;i>0;i--){
    scanf("%d",$num[i]);
    if(num[i]>=Mini && num[i]<=Maxes){
      if(num[i]!=2 && num[i]%2==0) count++;
      else{
	for(j=3;j<=sqrt(num[i]);j+=2){
	  if(num[i]%j==0){
	    count++;
	    break;
	  }
	}
      }
    }
    else break;
  }
  printf("%d\n",n-count);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:15:16: error: '$num' undeclared (first use in this function); did you mean 'num'?
   15 |     scanf("%d",$num[i]);
      |                ^~~~
      |                num
main.c:15:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:17: error: 'n' undeclared (first use in this function)
   29 |   printf("%d\n",n-count);
      |                 ^
Language: C

#include <mamth.h>
#include <stdio.h>
int main(){
  int A[10000],j;
  int i,count=0,a;

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

  for(a=0;a<i;a++){
       for(j=2;j<sqrt(A[a]);j++){
         if(A[j]%2==0)break;
         if(A[j]%j==0) {
           count++;
           break;
         }
       }
    }

  printf("%d\n",i-count);

  return 0;
}




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

include<stdio.h>

int main(){
  int n;
  scanf("%d",&n);
  int A[n];
  int i,j,g,a,m,count=0;

  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  for(g=0;g<i;g++){
    m=0;
   for(j=2;j<A[g];j++){
     if(A[g]==2){
       m=1;
       count++;
       continue;
     }
     a=A[g]%j;
     if(a==0){
       m=1;
       continue;
     }
   }
   if(m!=1)count++;
  }

  printf("%d\n",count);

  return 0;
}


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

#include <stdio.h>

int main(){
    int n,i,j,k,count=0;
    scanf("%d",&n);
    int A[i];
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<n;i++){
        k=A[i];
        for(j=1;j<k;j++){
            if(j==1) continue;
            else if(j==k) continue;
            else if(k%j==0) count++;
            else continue;
        }
        if(count==0) add++;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:22: error: 'add' undeclared (first use in this function)
   18 |         if(count==0) add++;
      |                      ^~~
main.c:18:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int isPrime(int);

int main(){
  int i,f,j,l,count,a;

  count = 0;
  
  scanf("%d",&l);
  
  for(i = 0; i < l; i++){
    scanf("%d",&a);
    count += isPrime(a);
  }

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

int isPrime(int a){
  int i;
    if(a == 2) return 1;
    else if(a == 1 || (a % 2) == 0) return 0;
    else {
      for(i = 3; i < a; i += 2)
	if((a % i) == 0) {
	  return 0;
	}
    }
    return 1;
  }
}



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

#include <stdin.h>
#include <stdlib.h>

int isPrime(int);

int main(int argc,char* argv[]){
  int i,c;

  c = 0;
  
  for(i = 1; i < atoi(argv[0]); i++)
    c += isPrime(atoi(argv[i]));

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

int isPrime(int a){
  int i;
    if(a == 1) return 0;
    else if(a == 2) return 1;
    else if(a % 2 == 0) return 0;
    else {
      for(i = 3; i < a; i += 2)
	if((a % i) == 0) {
	  return 0;
	}
    }
    return 1;
}



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

#include <stdio.h>
int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 3 ; j < =sqrt(x[i] ); j+=2){
              if(x[i] % j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}



Compiler output:
main.c: In function 'main':
main.c:14:27: error: expected expression before '=' token
   14 |           for(j = 3 ; j < =sqrt(x[i] ); j+=2){
      |                           ^
main.c:14:28: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   14 |           for(j = 3 ; j < =sqrt(x[i] ); j+=2){
      |                            ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | int main(){
main.c:14:28: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   14 |           for(j = 3 ; j < =sqrt(x[i] ); j+=2){
      |                            ^~~~
main.c:14:28: note: include '<math.h>' or provide a declaration of 'sqrt'
Language: C

#include <stdio.h>
#include<math.h>
int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 3 ; j < =sqrt(x[i] ); j+=2){
              if(x[i] % j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}



Compiler output:
main.c: In function 'main':
main.c:15:27: error: expected expression before '=' token
   15 |           for(j = 3 ; j < =sqrt(x[i] ); j+=2){
      |                           ^
Language: C

#include <stdio.h>
#include<math.h>
int main(){
  int i,j,n,x[10000],a=0;
  
  scanf("%d", &n);
  
  if(n >= 1 && n <= 100000){
  
      for(i = 0 ; i < n ; i++){
          scanf("%d",&x[i]);
      }
      
      for(i = 0 ; i < n ; i++){
          for(j = 3 ; j <=sqrt(x[i] ) j+=2){
              if(x[i] % j == 0){
                  a++;
              break;
              }
          }
      }
      
      printf("%d\n",n-a);
      
  }
}



Compiler output:
main.c: In function 'main':
main.c:15:38: error: expected ';' before 'j'
   15 |           for(j = 3 ; j <=sqrt(x[i] ) j+=2){
      |                                      ^~
      |                                      ;
Language: C

#include<stdio.h>
#include<math.h>
int isPrime(x , y){
  int i;
  if(y <= 3){
    return 1;
  }
  
  }
  for(i = 2;i<= x;i++){
    if(y % i == 0){
      return 0;
    }
  }
    return 1;
  }


int main(){
  int n;
  int result;
  int cnt=0;
  int i;
  int array[101];
  int ary[101];
  scanf("%d",&n);
  for(i = 0;i<n;i++){
    scanf("%d",&array[i]);
    
  }
  for(i=0;i<n;i++){
   ary[i] = sqrt(array[i]);
  result = isPrime(ary[i],array[i]); 
  cnt += result;
  }

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



Compiler output:
main.c: In function 'isPrime':
main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
    3 | int isPrime(x , y){
      |     ^~~~~~~
main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c: At top level:
main.c:10:3: error: expected identifier or '(' before 'for'
   10 |   for(i = 2;i<= x;i++){
      |   ^~~
main.c:10:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   10 |   for(i = 2;i<= x;i++){
      |              ^~
main.c:10:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   10 |   for(i = 2;i<= x;i++){
      |                    ^~
main.c:15:5: error: expected identifier or '(' before 'return'
   15 |     return 1;
      |     ^~~~~~
main.c:16:3: error: expected identifier or '(' before '}' token
   16 |   }
      |   ^
Language: C

#include<stdio.h>
#include<math.h>
int isPrime(x , y){
  int i;
  if(y <= 3){
    return 1;
  }
  
  
  for(i = 2;i<= x;i+2{
    if(y % i == 0){
      return 0;
    }
  }
    return 1;
  }


int main(){
  int n;
  int result;
  int cnt=0;
  int i;
  int array[101];
  int ary[101];
  scanf("%d",&n);
  for(i = 0;i<n;i+=2){
    scanf("%d",&array[i]);
    
  }
  for(i=0;i<n;i++){
   ary[i] = sqrt(array[i]);
  result = isPrime(ary[i],array[i]); 
  cnt += result;
  }

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



Compiler output:
main.c: In function 'isPrime':
main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
    3 | int isPrime(x , y){
      |     ^~~~~~~
main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:10:22: error: expected ')' before '{' token
   10 |   for(i = 2;i<= x;i+2{
      |      ~               ^
      |                      )
main.c:16:3: error: expected expression before '}' token
   16 |   }
      |   ^
Language: C

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

int primal_search (int);
int main(void){
    int n, count=0;
    scanf("%d", &n);
    
    for(int i=2, i<=n; i++){
        if(primal_search(i)){
            count++if
        }
    }
    
    printf("%d\n",count);
    
    return 0;
    // Your code here!
    
}

int primal_search(int n){
    int root_n = sqrt(n)*1;
    
    if(n <= 1){
        return 0;
    }else if(n % 2 == 0 && n != 2){
        return 0;
    }else{
        for(int i=3; i<root_n; i += 2){
            int r = n % i;
            if(r == 0){
                return 0;
            }
        }
    }
    
    }
}


Compiler output:
main.c: In function 'main':
main.c:9:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    9 |     for(int i=2, i<=n; i++){
      |                   ^~
main.c:9:27: error: expected ';' before ')' token
    9 |     for(int i=2, i<=n; i++){
      |                           ^
      |                           ;
main.c:11:20: error: expected ';' before 'if'
   11 |             count++if
      |                    ^~
      |                    ;
main.c: At top level:
main.c:39:1: error: expected identifier or '(' before '}' token
   39 | }
      | ^
Language: C

#include <stdio.h>

int main() {
  int a[];
  int b[];
  int k = 0;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] / j = 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

  for(int i = 0; i < k; i++) {
    printf("%d", b[i]);
  }
}


Compiler output:
main.c: In function 'main':
main.c:4:7: error: array size missing in 'a'
    4 |   int a[];
      |       ^
main.c:5:7: error: array size missing in 'b'
    5 |   int b[];
      |       ^
main.c:8:16: error: 'n' undeclared (first use in this function)
    8 |   scanf("%d", &n);
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:19: error: lvalue required as left operand of assignment
   15 |       if(a[i] / j = 0) count++;
      |                   ^
Language: C

#include <stdio.h>

int main() {
  int a[1000000];
  int b[1000000];
  int k = 0;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] / j = 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

  for(int i = 0; i < k; i++) {
    printf("%d", b[i]);
  }
}


Compiler output:
main.c: In function 'main':
main.c:8:16: error: 'n' undeclared (first use in this function)
    8 |   scanf("%d", &n);
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:19: error: lvalue required as left operand of assignment
   15 |       if(a[i] / j = 0) count++;
      |                   ^
Language: C

#include <stdio.h>

int main() {
  int a[1000000];
  int b[1000000];
  int k = 0;
  int n;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] / j = 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

  for(int i = 0; i < k; i++) {
    printf("%d", b[i]);
  }
}


Compiler output:
main.c: In function 'main':
main.c:16:19: error: lvalue required as left operand of assignment
   16 |       if(a[i] / j = 0) count++;
      |                   ^
Language: C

#include <stdio.h>

int main() {
  int a[100000] = {};
  int b[100000] = {};
  int k = 0;
  int n;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] / j = 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

  for(int i = 0; i < k; i++) {
    printf("%d", b[i]);
  }
}


Compiler output:
main.c: In function 'main':
main.c:16:19: error: lvalue required as left operand of assignment
   16 |       if(a[i] / j = 0) count++;
      |                   ^
Language: C

#include <iostream>
#include <algorithm>
#define mx 100000001

using namespace std;

int main()
{
  int t, n, cnt;
  bool pm[mx];

  fill(pm, pm+mx, true);
  pm[0] = pm[1] = false;

  for(int i = 2; i < mx; ++i)
    if(pm[i])
      for(int j = i*2; j < mx; j+=i)
	pm[j] = false;

  while(cin>>n && n){
    cnt = 0;
    while(n-- && cin>>t) if(pm[t]) ++cnt;
    cout << cnt << endl;
  }

  return 0;
}

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

#include<stdio.h>
#include<math.h>
int main(void){
  int A[1000];
  int N,i,j,C,x;
  C=0;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
    x=0;
    for(j=2;j<=(sqrt)A[i];j++){
      if(A[i]%j==0)x++;
    }
    if(x==0)C++;
  }
  printf("%d\n",C);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: warning: comparison between pointer and integer
   12 |     for(j=2;j<=(sqrt)A[i];j++){
      |              ^~
main.c:12:22: error: expected ';' before 'A'
   12 |     for(j=2;j<=(sqrt)A[i];j++){
      |                      ^
      |                      ;
Language: C

#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

bool isPrime(int n) {//???????卒???属 
	if (n == 1) return false;
	int q = (int)sqrt(n);
	for (int i=2; i<=q; ++i) {
		if (n % i == 0) return false;
	}
	return true;
}

int main() {
	int n;
	while (scanf("%d", &n) != EOF) {
		int num;
		int cnt = 0;
		while (n--) {
			scanf ("%d", &num);
			if (isPrime(num)) ++cnt;
		}
		printf ("%d\n", cnt);
	}
	return 0;
}

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

#include<iostream>

using namespace std;

int main(){
    int n;
    while(1){
        cin>>n;
        if(n==0)break;
        int input[10000]={0};
        int max = 0;
        for(int i=0; i<n; i++){
            cin>>input[i];
            if(max<input[i])max=input[i];
        }
        
        int sosuu[max];
        for(int i=0; i<=max; i++)sosuu[i]=1;
        
        sosuu[0]=0;
        sosuu[1]=0;
        for(int i=2; i<=max; i++){
            int now = i;
            if(sosuu[i]==1){
                while(now<=max){
                    now+=i;
                    sosuu[now]=0;
                }
            }
        }
        
        int sum=0;
        for(int i=0; i<n; i++){
            sum+=sosuu[input[i]];
            sosuu[input[i]]=0;
        }
        cout<<sum<<endl;
    }
}

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

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef vector <int> ivector;

int seive(ivector &A, int n){
	ivector num(n+1,1);
	num[0]=0;
	num[1]=0;
	int count=1, limit=int(sqrt(n));
	for (int i=3; i<=n; i+=2)
		if (num[i]){
			count++;
			if (i<=limit)
				for (int j=3*i; j<=n; j+=2*i) num[j]=0;
		}

	A.resize(count);
	A[0] = 2;
	int j=1;
	for (int i=3; i<=n; i+=2)
		if (num[i]==1) A[j++]=i;
	return 0;
}

int main(void){
	ivector primes;
	int max_num=10000;
	seive(primes, max_num);

	int n, n0, lim, count;
	cin >> n;
	count = n;
	for (int i=0; i<n; i++){
		cin >> n0;
		lim = int(sqrt(n0));
		for (int j=0; j<(int)primes.size(); j++){
			int tmp=primes[j];

			if (tmp *tmp > n0)break;
			if (n0 % tmp == 0){
				count--;
				break;
			}
		}
	}
		cout<<count<<endl;
		return 0;
}

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

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

int prime_check(long x);

int main(void) {
    int N, i, count = 0;
    long x;
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
        scanf("%d", &x);
        if(prime_check(x)) count++;
    }
    printf ("%d\n", count);
}

int prime_check(int x)
{
    int i;
    int root_x = (int)(sqrt(x));
    if (x == 2) return 1;
    if (x < 2 || x % 2 == 0) return 0;
    for (i = 2; i <= root_x; i++) {
        if (x % i == 0) return 0;
    }
    return 1;
}

Compiler output:
main.c:17:5: error: conflicting types for 'prime_check'; have 'int(int)'
   17 | int prime_check(int x)
      |     ^~~~~~~~~~~
main.c:4:5: note: previous declaration of 'prime_check' with type 'int(long int)'
    4 | int prime_check(long x);
      |     ^~~~~~~~~~~
Language: C

#include<iostream>
#define MAX 100000001
using namespace std;
bool isP[MAX];
void make_table(){
  for(int i=0;i<MAX;i++)isP[i]=true;
  isP[0]=isP[1]=false;
  for(int i=2;i*i<MAX;i++){
    if(!isP[i])continue;
    for(int j=i*i;j<MAX;j+=i){
      isP[j]=false;
    }
  }
}

int main(){
  make_table();
  int n,a,cnt=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a;
    cnt+=isP[a];
  }
  cout<<cnt<<endl;
}

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

#include <stdio.h>
#define N 10000 
int sosuu(int );
int main(){
  int i,j,n,a[N],key,c=0;
  
  scanf("%d",&n);

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

  for(i=1;i<n;i++){
    key=a[i];
    j=i-1;
    while(j>=0 && a[j]>key){
      a[j+1]=a[j];
      j--;
    }
    a[j+1]=key;
  }
  c+=souu(a[0]);
  for(i=1;i<n;i++){
    if (a[i]!=a[i-1]){
     c += sosuu(a[i]); 
    }
  }
  printf("%d\n",c);
  return 0;
}

int sosuu(int x){
  int i,j=0;
  if(x==1)return 0;
  for(i=2; i <= x/2 ;i++){
    if(x%i==0)return 0;
  }
  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:22:6: error: implicit declaration of function 'souu'; did you mean 'sosuu'? [-Wimplicit-function-declaration]
   22 |   c+=souu(a[0]);
      |      ^~~~
      |      sosuu
Language: C

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

static const int N = 10000;
int isprime(int);

int main(){
  
  int count=0,n,A[N],i,c1,c2;
  
  scanf("%d",&n);
  for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
  for(i=0;i<n;i++){
    if(isprim(A[i])==0){
      count++;
    }
  }
  printf("\n%d\n",count);
  
  int isprime(int A){
    if(A == 2){ 
      return 0;
    }
    c1=A%2;
    if(A < 2 || c1==0){
      return 1;
    }
    i = 3;
    while(i <=(int)sqrt(A)){
      c2=A%i;
      if(c2==0)
	return 1;
      i = i + 2;
      return 0;
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:8: error: implicit declaration of function 'isprim'; did you mean 'isprime'? [-Wimplicit-function-declaration]
   14 |     if(isprim(A[i])==0){
      |        ^~~~~~
      |        isprime