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

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

  int isprime(x)
  {
    if(x==2) return 1;
    
    else if(x<2||x%2==0) return 0;
    
    i=3;
    while(i<=sqrt(x)){
      if(x%i==0) return 0;
      i=i+2;
    }
    
    return 1  ;
} 

Compiler output:
main.c: In function 'isprime':
main.c:22:7: error: type of 'x' defaults to 'int' [-Wimplicit-int]
   22 |   int isprime(x)
      |       ^~~~~~~
main.c: In function 'main':
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C

include <stdio.h>



int check(int);


int main(){
  int N,i,a;
  int count=0;
  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%d",&a);
    if(check(a))count++;
  }
  
  printf("%d\n",count);
  
  return 0;
}

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

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&N);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&N);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:8: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
   15 |     if(check(a))count++;
      |        ^~~~~
main.c:18:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |   printf("%d\n",count);
      |   ^~~~~~
main.c:18:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<math.h>
#define N 10000


int main(){
  int i=0,A[N],count=0,count2=0,n,k,r;
  
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  for(i=0;i<n;i++){  
     
    while(1){    
      if(A[i]<=1]) break;      
    if(A[i]==2) {count++; break;}
      else if(A[i]<2 || A[i]%2==0) break;
      else{
	while(k<A[i]){	
	  k++;
	  r=A[i]%k;
	  if(r=0){
	    count++;
	    break;}}
	  break;}
    return 0;  }
}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: expected ')' before ']' token
   14 |       if(A[i]<=1]) break;
      |         ~       ^
      |                 )
main.c:14:17: error: expected statement before ']' token
main.c:14:18: error: expected statement before ')' token
   14 |       if(A[i]<=1]) break;
      |                  ^
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C

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

main()
{
  double a[10000];
  int i, j, length, count = 0, flag = 0;

  scanf("%d", &length);

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

  for(i = 0; i < length; i++)
    {
      if(a[i] != 2 && a[i] % 2 == 0)
	{
	  flag = 1;
	}
      else
	{
	  for(j = 2; j < sqrt(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:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:18:28: error: invalid operands to binary % (have 'double' and 'int')
   18 |       if(a[i] != 2 && a[i] % 2 == 0)
      |                       ~~~~ ^
      |                        |
      |                        double
main.c:26:23: error: invalid operands to binary % (have 'double' and 'int')
   26 |               if(a[i] % j == 0)
      |                  ~~~~ ^
      |                   |
      |                   double
Language: C

main(){
  int i=0,A[N],count=0,count2=0,n,k;
  
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  for(i=0;i<n;i++){  
    
for(k=2,count2=0;k<A[i];k++){     
  if(A[i]%2==0) break;  
    if(A[i]%k==0){
	count2++;
	break;}}
    if(count2==0) count++;
  }

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

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

#include<stdio.h>
#include<math.h>
int main(){
  int h=0,i,N,t=0,j;
  scanf("%d",&N);
  int hairetu[N];
  for(i=0;i<N;i++){
    scanf("%d",&hairetu[i]);
  }  
  for(i=0;i<N;i++){
      h=0;
      for(j=2;j<square(hairetu[i]);j++){
      if(hairetu[i]%j==0)h++;
    }
    if(h==0)t++;
  }
  printf("%d\n",t);  
  return 0;
}

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

include <stdio.h>

int isprime(int);

main(){

  int kosu,n[10000],ans = 0;
  int i,j;

  scanf("%d",&kosu);

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

   for(i = 0 ; i < kosu ; i++){
     if(isprime(n[i]) == 1) ans++;

  }

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

return 0;

}



int isprime(int x){

  int i;

  if(x <= 1) return 0;

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

  return 1;

}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |   scanf("%d",&kosu);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:10:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |   scanf("%d",&kosu);
      |   ^~~~~
main.c:10:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:9: error: implicit declaration of function 'isprime' [-Wimplicit-function-declaration]
   17 |      if(isprime(n[i]) == 1) ans++;
      |         ^~~~~~~
main.c:21:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |   printf("%d\n",ans);
      |   ^~~~~~
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int isprime(int);

main(){

  int kosu,n[10000],ans = 0;
  int i,j;

  scanf("%d",&kosu);

  for(i = 0 ; i < kosu ; i++){
    scanf("%d",&n[i]);
    if(isprime(n[i]) == 1) ans++;
  }

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

  return 0;

}



int isprime(int x){

  int i;

  if(x <= 1) return 0;

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

  return 1;

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




int isprime(int x)
{
  int i = 3;
  if(x == 2) return 1;
    if(x % 2 == 0) return 2;
  while(i <= sqrt(x) ){
    if(x % i == 0) return 2;
	  i = i + 2;
 }
         return 1;
}	       

int main(void){

  int j,t,m;
  int A[N];
  scanf("%d",&t);
 for(j = 0 ; j < t ; j++){
    scanf("%d",&A[j]);
   if(isprime(A[j]) == 1) m = m + 1;
  }
  printf("%d\n",m);
  return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:9:14: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    9 |   while(i <= sqrt(x) ){
      |              ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | 
main.c:9:14: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    9 |   while(i <= sqrt(x) ){
      |              ^~~~
main.c:9:14: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: In function 'main':
main.c:19:9: error: 'N' undeclared (first use in this function)
   19 |   int A[N];
      |         ^
main.c:19:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   scanf("%d",&t);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:20:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   scanf("%d",&t);
      |   ^~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |   printf("%d\n",m);
      |   ^~~~~~
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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


int isprime(int x)
{
  int i = 3;
  if(x == 2) return 1;
    if(x % 2 == 0) return 2;
  while(i <= sqrt(x) ){
    if(x % i == 0) return 2;
	  i = i + 2;
 }
         return 1;
}	       

int main(void){

  int j,t,m;
  int A[N];
  scanf("%d",&t);
 for(j = 0 ; j < t ; j++){
    scanf("%d",&A[j]);
   if(isprime(A[j]) == 1) m = m + 1;
  }
  printf("%d\n",m);
  return 0;
}

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

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



int main(void){

  int j,t,m;
  int A[N];
  scanf("%d",&t);
 for(j = 0 ; j < t ; j++){
    scanf("%d",&A[j]);
   if(isprime(A[j]) == 1) m = m + 1;
  }
  printf("%d\n",m);
  return 0;
}
int isprime(int x)
{
  int i = 3;
  if(x == 2) return 1;
    if(x % 2 == 0) return 2;
  while(i <= sqrt(x) ){
    if(x % i == 0) return 2;
	  i = i + 2;
 }
         return 1;
}	       

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'N' undeclared (first use in this function)
    9 |   int A[N];
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:7: error: implicit declaration of function 'isprime' [-Wimplicit-function-declaration]
   13 |    if(isprime(A[j]) == 1) m = m + 1;
      |       ^~~~~~~
Language: C

include<stdio.h>
#define N 1000

int main(){
  int a[N],  k, ans, w, j, an;
   scanf("%d", &a[0]);
  for(k=1; k <= a[0]; k++) scanf("%d", &a[k]); 

  for(k=1; k <= a[0]; k++){

    for(j=1; j <= a[k]; j++) {
      an = a[k] % j;
      if(an == 0) w++;
      if(w == 2 && j != a[k]) break;
      else if(w == 2) ans++;
    }

    w=0;
  }

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

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

#include<stdio.h>
#define N 100

int main(){
	int i,j,c,a,A[N];

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

	for(i=0;i<a;i++){
		for(j=a-1;j>=i+1;j--){
			if(A[j]<A[j-1]){
				swap(A[j],A[j-1])
					c++;
			}
		}
	}
	for(i=0;i<a;i++){
		if(i>=1)printf("");		
		printf("%d",A[i]);	
		}
	printf("\n%d\n",c);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:33: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   15 |                                 swap(A[j],A[j-1])
      |                                 ^~~~
main.c:15:50: error: expected ';' before 'c'
   15 |                                 swap(A[j],A[j-1])
      |                                                  ^
      |                                                  ;
   16 |                                         c++;
      |                                         ~
Language: C

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

#define NUM 100000000
unsigned prime[NUM+2];

void create_prime(void)
{
    unsigned i, j;
	unsigned size;
    unsigned sq_num = (int)sqrt((double)NUM);

	memset((char*)prime, 0xFF, sizeof(prime));
    prime[0] = 0;
	prime[1] = 0;
	
    for (i=2;i<=sq_num;i++) {
    	if (prime[i] != 0) {
    		for (j=2;i*j<=NUM;j++){
        		prime[i*j] = 0;
    		}
    	}
    }
}

int main(void) {
	int i, n, value;
	int count = 0;
	
	create_prime();
	
	scanf("%d\n", &n);
	for(i=0;i<n;i++) {
		scanf("%d\n", &value);
		if(primes[value] != 0) {
			count++;
		}
	}
	
	printf("%d\n", count);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:36:20: error: 'primes' undeclared (first use in this function); did you mean 'prime'?
   36 |                 if(primes[value] != 0) {
      |                    ^~~~~~
      |                    prime
main.c:36:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>

int num[10000000] = { 0 };

void func(int n){
	for (int i = 2; i <= n; ++i){
		bool f = true;
		for (int j = 2; j*j <= i; ++j){
			if (i%j == 0)f = false;
		}
		if (f)num[i] = 1;
		else num[i] = 0;
	}
}

int main(){
	int n;
	std::cin >> n;
	int ans=0;
	func(10000000);
	for (int i = 0; i < n; ++i){
		int a;
		std::cin >> a;
		if (num[a] == 1){
			ans++;
		}
		//std::cout << num[i] << std::endl;
	}
	std::cout << ans << std::endl;
	return 0;
}

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

n = int(input())
ls = [int(input()) for _ in range(n)]

def judge(n):
    if n == 2 or n == 3:
        return 1
    div = 3
    while div < n/2:
        if n%2 == 0 or n%div == 0:
            return 0
        else:  
            div += 2
    return 1

print(sum(map(judge, ls)))


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception{
	int i=0;
	int Prime_COUNT = 0;
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	String str_A = br.readLine();
	
	int n = Integer.parseInt(str_A);
	
	int A[];
	A = new int[n];
	 
	for(i=0;i<A.length;i++){
	    String a = br.readLine();
	    A[i] = Integer.parseInt(a);
	}
	
	for(i=0;i<A.length;i++){
	    isPrime(A[i]);
	    if(isPrime(A[i]) == true) Prime_COUNT++;
	}
	
	System.out.println(Prime_COUNT);
	return ;
    }

    public static boolean isPrime(int x){
	if(x == 2) return true;
	if(x<2 || x%2 == 0) return false;

	int i = 3;
	while(i<= Math.sqrt((double)x)){
	    if(x%i == 0) return false;
	    i = i+2;
	}

	return true;
    }
}
      



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:11: error: expected ':' before 'static'
    5 |     public static void main(String[] args) throws Exception{
      |           ^~~~~~~
      |           :
a.cc:5:29: error: 'String' has not been declared
    5 |     public static void main(String[] args) throws Exception{
      |                             ^~~~~~
a.cc:5:38: error: expected ',' or '...' before 'args'
    5 |     public static void main(String[] args) throws Exception{
      |                                      ^~~~
a.cc:5:42: error: expected ';' at end of member declaration
    5 |     public static void main(String[] args) throws Exception{
      |                                          ^
      |                                           ;
a.cc:5:44: error: 'throws' does not name a type
    5 |     public static void main(String[] args) throws Exception{
      |                                            ^~~~~~
a.cc:31:11: error: expected ':' before 'static'
   31 |     public static boolean isPrime(int x){
      |           ^~~~~~~
      |           :
a.cc:31:19: error: 'boolean' does not name a type; did you mean 'bool'?
   31 |     public static boolean isPrime(int x){
      |                   ^~~~~~~
      |                   bool
a.cc:43:2: error: expected ';' after class definition
   43 | }
      |  ^
      |  ;
Language: C++

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

template<size_t max_N, size_t prime_size>
class Prime{
    bool sieve[max_N];
    int_fast64_t prime[prime_size];
    size_t counter = 1;
public:
    constexpr Prime() : sieve(), prime() {
        for(int_fast64_t i = 0; i < max_N; ++i)
            sieve[i] = i & 1;
        sieve[0] = sieve[1] = false;
        sieve[2] = true;
        prime[0] = 2;
        for(int_fast64_t i = 3; i < max_N; ++i){
            if(sieve[i]){
                prime[counter] = i;
                ++counter;
                if(counter >= prime_size)break;
            }
            for(int_fast64_t j = i * i; j < max_N; j += i)
                sieve[j] = false;
        }
    }
    constexpr bool operator[](size_t i) const {
        return sieve[i];
    }
};

constexpr auto p = Prime<100000001, 170>();
uint_fast64_t N, a, b;

int main(){
    scanf("%lld%lld", &N, &a);
    for(;N--;scanf("%lld", &a))b += p[a];
    cout << b << endl;
    return 0;
}


Compiler output:
a.cc:31:42:   in 'constexpr' expansion of 'Prime<100000001, 170>()'
a.cc:11:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   11 |         for(int_fast64_t i = 0; i < max_N; ++i)
      |         ^~~
Language: C++

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

template<size_t max_N>
class LargeSieve{
    uint_fast64_t n = max_N >> 6;
    uint_fast64_t sieve[(max_N >> 6) + 1];
public:
    constexpr LargeSieve() : sieve(){
        // noshi91さんのコードを参考にしました
        // http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=3039786#1
        for(size_t i = 0; i < max_N >> 6; ++i)
            sieve[i] = 12297829382473034410;
        sieve[0] ^= 6;
        for(size_t i = 2; i * i < max_N; ++i)
            if(sieve[i >> 6] >> (i & 0x3F) & 1)
                for(size_t j = i * i; j < max_N; j += i)
                    sieve[j >> 6] &= ~(static_cast<uint_fast64_t>(1) << (j & 0x3F));
    }
    constexpr bool operator[](size_t i) const {
        return sieve[i >> 6] >> (i & 0x3F) & 1;
    }
};

constexpr auto p = LargeSieve<100000001>();
uint_fast64_t a, b;

int main(){
    scanf("%lu", &a);
    for(;cin >> a;)b += p[a];
    cout << b << endl;
    return 0;
}


Compiler output:
a.cc:13:24: warning: integer constant is so large that it is unsigned
   13 |             sieve[i] = 12297829382473034410;
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc:25:42:   in 'constexpr' expansion of 'LargeSieve<100000001>()'
a.cc:12:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   12 |         for(size_t i = 0; i < max_N >> 6; ++i)
      |         ^~~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n, ans=0;
	vector<int> num(10000);
	
	//input
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> num[i];
	}

	vector<int> pm(1);
	pm[0] = 2;
	
	for (int j = 3; j <= 100000; j++) {
		for (int k = 0; k < pm.size(); k++) {
			if (j%pm[k] == 0) break;
			if (k == pm.size() - 1 && j%pm[k] != 0) {
				pm.push_back(j);
				//if (pm.size() % 100 == 0) {
				//	cout << "素数を見つけました : " << j << endl;
				//}
			}
		}
	}
	
	//cout << pm[pm.size() - 1] << endl;

	for (int i = 0; i < n;i++) {
		for (int j = 0; j < pm.size(); j++) {
			if (num[i] % pm[j] == 0) {
				if (num[i] == pm[j]) {
					ans++;
					//cout << "ans++_1 : " << num[i] << endl;
				}
				break;
			}
		}
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
bool Prime_Numbers(int n)
{
	int i=0;
	for (i = 2; i < n; i++)
		if (n%i == 0)break;
	if (i >= n)
		
}
int main()
{
	int n,x,i;
	int count = 0;
	cin >> x;
	for (int i = 0; i < x; i++)
	{
		cin >> n;
		for (i = 2; i < n; i++)
		if (n%i == 0)break;
		if (i >= n)
			count++;
	}
	cout << count << endl;
	//system("pause");
	return 0;
}


Compiler output:
a.cc: In function 'bool Prime_Numbers(int)':
a.cc:10:1: error: expected primary-expression before '}' token
   10 | }
      | ^
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

bool isprime(unsigned int x)
{
	if (x == 2) return true;

	if (x < 2 || x % 2 == 0)
		return false;

	unsigned int i = 3;
	while (i <= sqrt(x)) {
		if x が i で割り切れる
		  return false;
		i = i + 2
	}

	return true;
}

int main()
{
	unsigned int n;
	unsigned int ans = 0;
	for (unsigned int i = 0; i < n; ++i) {
		unsigned int x;
		cin >> x;
		if (isprime(x)) ++ans;
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'bool isprime(unsigned int)':
a.cc:15:20: error: expected '(' before 'x'
   15 |                 if x が i で割り切れる
      |                    ^
      |                    (
a.cc:17:26: error: expected ';' before '}' token
   17 |                 i = i + 2
      |                          ^
      |                          ;
   18 |         }
      |         ~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

bool isprime(unsigned int x)
{
	if (x == 2) return true;

	if (x < 2 || x % 2 == 0)
		return false;

	unsigned int i = 3;
	while (i <= sqrt(x)) {
		if (x % i == 0)
		  return false;
		i = i + 2
	}

	return true;
}

int main()
{
	unsigned int n;
	unsigned int ans = 0;
	for (unsigned int i = 0; i < n; ++i) {
		unsigned int x;
		cin >> x;
		if (isprime(x)) ++ans;
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'bool isprime(unsigned int)':
a.cc:17:26: error: expected ';' before '}' token
   17 |                 i = i + 2
      |                          ^
      |                          ;
   18 |         }
      |         ~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int n; cin>>n;
    int a,ans=0;
    bool b,c;
    vector<int>c(n,0);
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    for(int i=0;i<n;i++){
        if(c[i]==2){c==true;}
        for(int j=2;j<=c[i]/2;j++){
            a=c[i]%j;
            if(a==0){
                b=false;
            }
        }
        if(b){
            ans++;
        }
        if(c){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: conflicting declaration 'std::vector<int> c'
   10 |     vector<int>c(n,0);
      |                ^
a.cc:9:12: note: previous declaration as 'bool c'
    9 |     bool b,c;
      |            ^
a.cc:12:15: error: invalid types 'bool[int]' for array subscript
   12 |         cin>>c[i];
      |               ^
a.cc:15:13: error: invalid types 'bool[int]' for array subscript
   15 |         if(c[i]==2){c==true;}
      |             ^
a.cc:16:25: error: invalid types 'bool[int]' for array subscript
   16 |         for(int j=2;j<=c[i]/2;j++){
      |                         ^
a.cc:17:16: error: invalid types 'bool[int]' for array subscript
   17 |             a=c[i]%j;
      |                ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

bool isprime(int x){
    if(x==2){
        return true;
    } 
    else if(x%2==0){
        return false;
    }
    int i=3;
    while(i<=sqrt(x)){
        if(x%i==0){
            return false;
        }
        i=i+2;
    }
}
int main(){
    int n,ans=0; cin>>n;
    vector<int>c(n,0);
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    for(int i=0;i<n;i++){
        if(isprime(c[i])){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:14:14: error: 'sqrt' was not declared in this scope
   14 |     while(i<=sqrt(x)){
      |              ^~~~
a.cc:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
Language: C++

#include<iostream>
#include<math>
using namespace std;

bool isprime(int x){
  if(x == 2){
    return true;
  }
  if(x < 2 || x%2==0){
    return false;
  }
  i = 3;
  while( i <= sqrt(x)){
    if(x%i==0){
      return false;
    }
    i = i + 2;
  }

 return true
}

int main(){
    int n, x, count=0;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> x;
        if(isprime(x)) count++;
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: math: No such file or directory
    2 | #include<math>
      |         ^~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

bool isprime(int x){
  if(x == 2){
    return true;
  }
  if(x < 2 || x%2==0){
    return false;
  }
  i = 3;
  while( i <= sqrt(x)){
    if(x%i==0){
      return false;
    }
    i = i + 2;
  }

 return true
}

int main(){
    int n, x, count=0;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> x;
        if(isprime(x)) count++;
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:12:3: error: 'i' was not declared in this scope
   12 |   i = 3;
      |   ^
a.cc:20:13: error: expected ';' before '}' token
   20 |  return true
      |             ^
      |             ;
   21 | }
      | ~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

bool isprime(int x){
  if(x == 2){
    return true;
  }
  if(x < 2 || x%2==0){
    return false;
  }
  int i = 3;
  while( i <= sqrt(x)){
    if(x%i==0){
      return false;
    }
    i = i + 2;
  }

 return true
}

int main(){
    int n, x, count=0;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> x;
        if(isprime(x)) count++;
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:20:13: error: expected ';' before '}' token
   20 |  return true
      |             ^
      |             ;
   21 | }
      | ~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n; cin>>n
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        for(int j=2;j<=a[i]/2;j++){
            if(a[i]%j==0){
                cout<<a[i]<<endl;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected ';' before 'vector'
    6 |     int n; cin>>n
      |                  ^
      |                  ;
    7 |     vector<int>a(n);
      |     ~~~~~~        
a.cc:9:14: error: 'a' was not declared in this scope
    9 |         cin>>a[i];
      |              ^
a.cc:12:24: error: 'a' was not declared in this scope
   12 |         for(int j=2;j<=a[i]/2;j++){
      |                        ^
Language: C++

import math
 
 
def main():
    n = int(input())
    ans = 0
    for i in range(n):
        x = int(input())
        if x == 2:
            ans += 1
        elif x % 2 == 0:
            pass
        else:
            flag = True
            j = 3
            while j <= math.sqrt(x):
                if x % j == 0:
                    flag = False
                    break
                j += 2
            if flag:
                ans += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()


Compiler output:
a.cc:26:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   26 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;
int main(){
    //def
    int n, sum=0;
    cin >> n;
    int num[n];
    for(int i=0;i<n;i++){
        cin >> num[i];
    }
    
    //equation
    for(int i=0;i<n;i++){
        for(int j=2;j<num[i];j++){
            if(num[i]%j==0){
                break;
            }
        }
        if(j == num[i]){
            sum++;
        }
    }
    
    //output
    cout << sum << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'j' was not declared in this scope
   19 |         if(j == num[i]){
      |            ^
Language: C++


#include <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    int prime = 0;
    for(int i : A){
        cin >> i;
    }
    for(int i : A){
        for(int j = 0;j < i;j++){
            if(i % j == 0){
                prime++;
                break;
            }
        }
    }
    cout << prime << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> A(N);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <iostream>
  +++ |+#include <vector>
    3 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> A(N);
      |            ^~~
a.cc:11:17: error: 'A' was not declared in this scope
   11 |     for(int i : A){
      |                 ^
a.cc:14:17: error: 'A' was not declared in this scope
   14 |     for(int i : A){
      |                 ^
Language: C++


#include <iostream>
#include <cmath>

using namespace std;


bool isPrime(int x){
    if(x == 2){
        return true;
    }
    if(x == 1 || x % 2 == 0){
        return false;
    }

    for(int i = 3;i < sqrt(x);i++){
        if(x % i == 0){
            return false;
        }
    }
    return true;

}

int main(){
    int N;
    cin >> N;
    int prime = 0;
    for(int i = 0;i < N;i++){
        int x;
        cin >> x;
        if(isPrime(x)){
            prime++;
        }
        }
    }
    cout << prime << endl;
}



Compiler output:
a.cc:37:5: error: 'cout' does not name a type
   37 |     cout << prime << endl;
      |     ^~~~
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

int main() {
	int n, i, j, x, total = 0;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> x;
		if (x == 2) total++;
		if (x % 2 != 0) {
			for (j = 3; j <= (double)sqrt(x); j+=2){
				if (x%j == 0) goto a;
			}
			total++;
		a:;
		}
	}
	cout << total << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:50: error: 'sqrt' was not declared in this scope
   12 |                         for (j = 3; j <= (double)sqrt(x); j+=2){
      |                                                  ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
	using namespace std;
	
	bool check(int a){//aが素数かどうか
		
		if(a<=2)return false;
			int s=sqrt(a);
		for(int i=2;i<=s;i++){
			if(a%i==0)return false;
		}
		return true;
	}
	
/*bool check(int a){//a画素数かどうか
		int s=sqrt(a);
		vector<int>m;//aの平方根の範囲での素数
		for(int i=1;i<=s;i++){
			if(checkOf(i))m.push_back(i);
		}
		for(int i=0;i<m.size();i++)cout<<m[i]<<" ";
		for(int i=0;i<m.size();i++){
			if(a%m[i]==0)return false;
		}
		return true;
	}*/
	
	
	
int main(){
	int n[10000];
	int N;
	cin>>N;
	int count=0;
	for(int i=0;i<N;i++)cin>>n[i];
	for(int i=0;i<N;i++){
		if(check(n[i]))count++;
	}
	cout<<count<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:10:31: error: 'sqrt' was not declared in this scope
   10 |                         int s=sqrt(a);
      |                               ^~~~
Language: C++


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
	using namespace std;
	
	bool check(int a){//aが素数かどうか
		
		if(a<=2)return false;
			int s=sqrt(a);
		for(int i=2;i<=s;i++){
			if(a%i==0)return false;
		}
		return true;
	}
	
/*bool check(int a){//a画素数かどうか
		int s=sqrt(a);
		vector<int>m;//aの平方根の範囲での素数
		for(int i=1;i<=s;i++){
			if(checkOf(i))m.push_back(i);
		}
		for(int i=0;i<m.size();i++)cout<<m[i]<<" ";
		for(int i=0;i<m.size();i++){
			if(a%m[i]==0)return false;
		}
		return true;
	}*/
	
	
	
int main(){
	int n[10000];
	int N;
	cin>>N;
	int count=0;
	for(int i=0;i<N;i++)cin>>n[i];
	for(int i=0;i<N;i++){
		if(check(n[i]))count++;
	}
	cout<<count<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:11:31: error: 'sqrt' was not declared in this scope
   11 |                         int s=sqrt(a);
      |                               ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define MOD 1000000007
#define ALL(a) begin((a)),end((a))
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

bool isprime(int n)
{
	for (int i = 2; i*i < n; i++)
	{
		if (n%i == 0) return false;
	}
	return true;
}

int main()
{
	int n;
	while (cin >> n)
	{
		vi v;
		if (isprime(n)) v.push_back(n);
	}
	cout << v.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'v' was not declared in this scope
   41 |         cout << v.size() << endl;
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N,x;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		int cnt=2;
		while(cnt != x){
			if(x%cnt ==0){
				break;
			}
			cnt++;
		}
		if(cnt == x){
			cout << x << lend;
		}
	} 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: 'lend' was not declared in this scope
   17 |                         cout << x << lend;
      |                                      ^~~~
Language: C++

#include <iostream>
using namespace std;

int isPrime(int x);

int main(){
	int N,x;
	bool prime;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		isPrime(x);
	} 
	return 0;
}

int isPrime(int x){
	int cnt=3;
	if(x == 1){
		return 0;
	}else if(x == 2){
		cout << x <<endl;
		return 0;
	}else{
		while(cnt < sqrt(x)){
			if(x%cnt == 0){
				return 0;
			}
		}
		cout << x << endl;
		return 0;
	}
}

Compiler output:
a.cc: In function 'int isPrime(int)':
a.cc:25:29: error: 'sqrt' was not declared in this scope
   25 |                 while(cnt < sqrt(x)){
      |                             ^~~~
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;

int isPrime(int x);

int main(){
	int N,x;
	bool prime;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		isPrime(x);
	} 
	return 0;
}

int isPrime(int x){
	int cnt=3;
	if(x == 1){
		return 0;
	}else if(x == 2){
		cout << x <<endl;
		return 0;
	}else{
		while(cnt < sqrt(x)){
			if(x%cnt == 0){
				return 0;
			}
		}
		cout << x << endl;
		return 0;
	}
}

Compiler output:
a.cc: In function 'int isPrime(int)':
a.cc:26:29: error: 'sqrt' was not declared in this scope
   26 |                 while(cnt < sqrt(x)){
      |                             ^~~~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int isPrime(int x);

int main(){
	long N,x;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		isPrime(x);
	} 
	return 0;
}

int isPrime(long x){
	bool prime;
	if(x == 1){
		prime =false;
	}else if(x == 2){
		prime =true;
	}else if(x %2 == 0){
		prime = false;
	}else{
		for(int i=3;i<x; i=i+2){
			if(x%i == 0){
				prime = false;
				break;
			}else if(i > sqrt(x)){
				prime = true;
			}
		}
		if(prime){
			cout << x << endl;
		}
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccP67JCR.o: in function `main':
a.cc:(.text+0x44): undefined reference to `isPrime(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int isPrime(long x);

int main(){
	long N,x;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		isPrime(x);
	} 
	return 0;
}

int isPrime(long x){
	bool prime;
	int i=3;
	if(x == 1){
		prime =false;
	}else if(x == 2 && x == 3){
		prime =true;
	}else if((x%2) == 0){
		prime = false;
	}else{
		while(i < x)){
			if((x%i) == 0){
				prime = false;
				break;
			}else{
				prime = true;
			}
			i = i+2;
		}
	}
	if(prime){
		cout << x << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int isPrime(long int)':
a.cc:27:29: error: expected primary-expression before ')' token
   27 |                 while(i < x)){
      |                             ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

bool isPrime(int x);

int main(){
	int N,x,cnt;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		if(isPrime(x)){
			cnt++;;
	} 
	cout << cnt << endl;
	return 0;
}

bool isPrime(int x){
	bool prime=false;
	int i=3;
	if(x == 1){
	}else if((x == 2) || (x == 3)){
		prime =true;
	}else if((x%2) == 0){
	}else{
		while(i < x){
			if((x%i) == 0){
				break;
			}else if(i > sqrt(x)){
				prime = true;
				break;
			}
			i = i+2;
		}
	}
	return prime;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: a function-definition is not allowed here before '{' token
   19 | bool isPrime(int x){
      |                    ^
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

bool isPrime(int x);

int main(){
	int N,x,cnt;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		if(isPrime(x)){
			cnt++;
	} 
	cout << cnt << endl;
	return 0;
}

bool isPrime(int x){
	bool prime=false;
	int i=3;
	if(x == 1){
	}else if((x == 2) || (x == 3)){
		prime =true;
	}else if((x%2) == 0){
	}else{
		while(i < x){
			if((x%i) == 0){
				break;
			}else if(i > sqrt(x)){
				prime = true;
				break;
			}
			i = i+2;
		}
	}
	return prime;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: a function-definition is not allowed here before '{' token
   19 | bool isPrime(int x){
      |                    ^
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

std::bitset<100000000> array(0);
auto eratosthenes(long long int n)
 -> void{
	for(long long int i = 0; i < n;i++){
		array[i] = 1;
	}
	array[0] = 0;
	array[1] = 0;
	for(long long int i = 2; i <= sqrt(n);i++){
		if(array[i]){
			for(long long int j = 0;i*(j+2) <= n;j++){
				array[i*(j+2)] = 0;
			}
		}
	}
}

auto main()
 -> int{

	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);

	long long int n, a, Max = 0, result = 0;

	std::cin>>n;
	std::vector<int> A(n);
	for(auto &a : A){
		std::cin>> a;
		if(Max < a){
			Max = a;
		}
	}

	eratosthenes(Max+1);

	for(auto a : A){
		if(array[a]){
			result++;
		}
	}
	std::cout<<result<<"\n";
	return 0;
}

Compiler output:
a.cc:5:6: error: 'bitset' in namespace 'std' does not name a template type
    5 | std::bitset<100000000> array(0);
      |      ^~~~~~
a.cc:4:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    3 | #include <cmath>
  +++ |+#include <bitset>
    4 | 
a.cc: In function 'void eratosthenes(long long int)':
a.cc:9:17: error: 'array' was not declared in this scope; did you mean 'std::array'?
    9 |                 array[i] = 1;
      |                 ^~~~~
      |                 std::array
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
   99 |     struct array;
      |            ^~~~~
a.cc:11:9: error: 'array' was not declared in this scope; did you mean 'std::array'?
   11 |         array[0] = 0;
      |         ^~~~~
      |         std::array
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
   99 |     struct array;
      |            ^~~~~
a.cc: In function 'int main()':
a.cc:42:20: error: 'array' was not declared in this scope; did you mean 'std::array'?
   42 |                 if(array[a]){
      |                    ^~~~~
      |                    std::array
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
   99 |     struct array;
      |            ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

#define intmax 100000003
bool isprime[intmax];
void makeprime(int datasize){/*??¨???????????????????????????*/
	REP(i,datasize) if(i%2!=0) isprime[i] = true;
	isprime[1] = false;
	isprime[2] = true;
	for(ll int i=3;i<sqrt(datasize);i+=2){
		for(ll int j=i+2;j<datasize;j+=2){
			if(j%i==0) isprime[j] = false;
		}
	}
}

int main(){
	int n;
	cin >> n;
	int cnt = 0;
	ll int mmax = -1;
	ll int data[10001];
	REP(i,n){
		ll int tmp;
		cin >> tmp;
		data[i] = tmp;
		mmax = max(mmax,tmp);
	}
	makeprime(mmax+1);
	REP(i,n){
		if(isprime[data[i]])) cnt++;
	}
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:37: error: expected primary-expression before ')' token
   53 |                 if(isprime[data[i]])) cnt++;
      |                                     ^
Language: C++

#include<stdio.h>

#define P 1000000
#define UNDEFINE -1

int CheckPrime(int v);	//v????´???°??????1????????????
int GetPrime(int n);	//n??????????´???°????????????
int PRIME[P];			//?´???°?????????

int main(){
	int v = 0;
	int N = 0;
	scanf("%d", &N);
	int num = 0;

	for( int i = 0; i < P; i++ ){
		PRIME[i] = UNDEFINED;
	}

	for( int i = 0; i < N; i++ ){
		scanf("%d", &v);
		num += CheckPrime(v);
	}

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

	return 0;
}

int CheckPrime(int v){
	for( int i = 0; i < P; i++ ){
		if( PRIME[i] == UNDEFINED ){
			PRIME[i] = GetPrime(i);
		}
		if( v % PRIME[i] == 0){
			return 0;
		}
		if( v < PRIME[i] ){
			return 1;
		}
	}
	return 1;
}

int GetPrime(int n){
	if( n == 0 ){
		PRIME[0] = 2;
		return 2;
	}
	if( n == 1 ){
		PRIME[1] = 3;
		return 3;
	}
	if( PRIME[n-1] == UNDEFINED ){
		PRIME[n-1] = GetPrime(n-1);
	}

	int v = PRIME[n-1] + 2;

	for( int i = 0; i < n; i++){
		if( v % PRIME[i] == 0 ){
			i = 0;
			v += 2;
		}
	}
	PRIME[n] = v;
	return v;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'UNDEFINED' was not declared in this scope; did you mean 'UNDEFINE'?
   17 |                 PRIME[i] = UNDEFINED;
      |                            ^~~~~~~~~
      |                            UNDEFINE
a.cc: In function 'int CheckPrime(int)':
a.cc:32:33: error: 'UNDEFINED' was not declared in this scope; did you mean 'UNDEFINE'?
   32 |                 if( PRIME[i] == UNDEFINED ){
      |                                 ^~~~~~~~~
      |                                 UNDEFINE
a.cc: In function 'int GetPrime(int)':
a.cc:54:27: error: 'UNDEFINED' was not declared in this scope; did you mean 'UNDEFINE'?
   54 |         if( PRIME[n-1] == UNDEFINED ){
      |                           ^~~~~~~~~
      |                           UNDEFINE
Language: C++

#include<stdio.h>

int main()
{
	int n, A[10001], i;
	scanf("%d", &n);
	for (i = 0; i <= n - 1; i++)
	{
		scanf("%d\n", &A[i]);
	}
	int l, m = 0;
	for (i = 0; i <= n - 1; i++)
	{
		int k = 0;
		if (A[i] == 1) m = m - 1;
                if(A[i]%2==1)
               {
		for (l = 2; l<A[i]; l++)
		{
			if (A[i] % l == 0)
			{
				k = 1;
				break;
			}
		}
                if (k == 0) m++;
               }
                else {if(A[i]==2)m++}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected ';' before '}' token
   28 |                 else {if(A[i]==2)m++}
      |                                     ^
      |                                     ;
Language: C++

#include<iostream>
using namespace std;
bool sosuu(long int y)
{
	for (long int n = 3; n < sqrt(y); n += 2)
	{
		if (y%n == 0)
			return false;
	}
	return true;
}
int main()
{
	long int x,ans = 0;
	while (cin>>x)
	{
		if (sosuu(x) == true)
			ans++;
	}
	printf("%d", ans);
}

Compiler output:
a.cc: In function 'bool sosuu(long int)':
a.cc:5:34: error: 'sqrt' was not declared in this scope
    5 |         for (long int n = 3; n < sqrt(y); n += 2)
      |                                  ^~~~
Language: C++

import functools
def divise(n, divisor):
    if n % divisor == 0 and n != divisor:
        return 0
    else:
        return n

if __name__ == '__main__':
    number = int(input())
    origin = [int(input()) for _ in range(number)]

    divised = origin

    for i in range(2, max(origin)+1):
        divised = list(map(functools.partial(divise, divisor=i), divised))

    for j in range(number):
        if divised[j] == 0:
            origin.pop(j)

    print(len(origin))

Compiler output:
a.cc:8:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    8 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import functools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'