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

#include<iostream>
using namespace std;
class Main{
int main(){
int n, a;
cin >> n;

int count = 0;
for(int i = 0; i < n; i++){
   cin >> a;
   if(prime(a) == 1){count++;}
}
cout << count <<endl;
}


int prime(int n){
    if (n < 2){
        return 0;
    }
    else if (n == 2){
        return 1;
    } 

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

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

}

Compiler output:
a.cc:37:2: error: expected ';' after class definition
   37 | }
      |  ^
      |  ;
a.cc: In member function 'int Main::main()':
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
class Main{
int main(){
int n, a;
cin >> n;

int count = 0;
for(int i = 0; i < n; i++){
   cin >> a;
   if(prime(a) == 1){count++;}
}
cout << count <<endl;
}


int prime(int n){
    if (n < 2){
        return 0;
    }
    else if (n == 2){
        return 1;
    } 

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

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

}

Compiler output:
a.cc:37:2: error: expected ';' after class definition
   37 | }
      |  ^
      |  ;
a.cc: In member function 'int Main::main()':
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

class Main{

int main(){
int n, a;
cin >> n;

int count = 0;
for(int i = 0; i < n; i++){
   cin >> a;
   if(prime(a) == 1){count++;}
}
cout << count <<endl;
}


int prime(int n){
    if (n < 2){
        return 0;
    }
    else if (n == 2){
        return 1;
    } 

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

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

Compiler output:
a.cc:38:2: error: expected ';' after class definition
   38 | }
      |  ^
      |  ;
a.cc: In member function 'int Main::main()':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

class Main{

int main(){
int n, a;
cin >> n;

int count = 0;
for(int i = 0; i < n; i++){
   cin >> a;
   if(prime(a) == 1){count++;}
}
cout << count <<endl;
}


int prime(int n){
    if (n < 2){
        return 0;
    }
    else if (n == 2){
        return 1;
    } 

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

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

Compiler output:
a.cc:38:2: error: expected ';' after class definition
   38 | }}
      |  ^
      |  ;
a.cc: In member function 'int Main::main()':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: At global scope:
a.cc:38:2: error: expected declaration before '}' token
   38 | }}
      |  ^
Language: C++

#include<iostream>
using namespace std;

void inputData(int R[], int *N)
{
	cin >> *N;
	for (int i = 0; i < *N; i++)
	{
		cin >> R[i];
	}
}

void traceData(int R[], int N)
{
	int i;
	for (i = 0; i < (N - 1); i++)
	{
		cout << R[i];
	}
	cout << R[i];
}

bool isPrimeNumber(int in)
{
	if (in == 2) return true;
	if (in % 2 == 0) return false;
	int s = (int)sqrt((double)in);

	for (int i = 3; i < s; i=i+2)
	{
		if ((in % i) == 0)
		{
			return false;
		}
	}
	return true;
}

static const int MAX = 10000;

int main()
{
	int R[MAX];
	int N;
	int count = 0;
	inputData(R, &N);
	for (int i = 0; i < N; i++)
	{
		if (isPrimeNumber(R[i]))
		{
			count++;
		}
	}
	cout << count << endl;
	return 0;
}

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

#include<iostream>
using namespace std;

void inputData(int R[], int *N)
{
	cin >> *N;
	for (int i = 0; i < *N; i++)
	{
		cin >> R[i];
	}
}

bool isPrimeNumber(int in)
{
	if (in == 2) return true;
	if (in % 2 == 0) return false;
	int s = (int)sqrt((double)in);

	for (int i = 3; i < s; i=i+2)
	{
		if ((in % i) == 0)
		{
			return false;
		}
	}
	return true;
}

static const int MAX = 10000;

int main()
{
	int R[MAX];
	int N;
	int count = 0;
	inputData(R, &N);
	for (int i = 0; i < N; i++)
	{
		if (isPrimeNumber(R[i]))
		{
			count++;
		}
	}
	cout << count << endl;
	return 0;
}

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

#include<iostream>
#include <math.h>
using namespace std;
 
int main(){
    int N, x, c;c=0;
    cin >> N;
    for (int i =0; i < N; i++) {
       cin >> x;
       int fc;fc=0;
       for (int j =1; j < sqrt(x); j++) {
         if (x%j=0) fc+=1;
       }
       if (fc==2) c+=1;
    }
    cout << c;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: lvalue required as left operand of assignment
   12 |          if (x%j=0) fc+=1;
      |              ~^~
Language: C++

#include<iostream>
#include <math.h>
using namespace std;
 
int main(){
    int N, x, c;c=0;
    cin >> N;
    for (int i =0; i < N; i++) {
       cin >> x;
       int fc;fc=0;
       for (int j =1; j < sqrt(x); j++)
         if (x%j=0) fc+=1;
       
       if (fc==2) c+=1;
    }
    cout << c;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: lvalue required as left operand of assignment
   12 |          if (x%j=0) fc+=1;
      |              ~^~
Language: C++

#include <stdio.h> 

int main() { 
  int n,i,p; 
  int flag = 0; 
  scanf("%d", &n); 

  for( i=0;i<n;++i ) { 
   scanf("%d\n",&p) 
  } 
  for(i=2,i<p,i++){
     if( n%i==0 ) { 
      flag = 1; 
      break;
}

  if( flag==0 ){ 

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

}
  return 0; 

} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |    scanf("%d\n",&p)
      |                    ^
      |                    ;
   10 |   }
      |   ~                 
a.cc:11:18: error: expected ';' before ')' token
   11 |   for(i=2,i<p,i++){
      |                  ^
      |                  ;
a.cc:24:2: error: expected primary-expression at end of input
   24 | }
      |  ^
a.cc:24:2: error: expected ';' at end of input
   24 | }
      |  ^
      |  ;
a.cc:24:2: error: expected primary-expression at end of input
a.cc:24:2: error: expected ')' at end of input
   24 | }
      |  ^
      |  )
a.cc:11:6: note: to match this '('
   11 |   for(i=2,i<p,i++){
      |      ^
a.cc:24:2: error: expected statement at end of input
   24 | }
      |  ^
a.cc:24:2: error: expected '}' at end of input
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <stdio.h> 

int main() { 
  int n,i,p; 
  int flag = 0; 
  scanf("%d", &n); 

  for( i=0;i<n;++i ) { 
   scanf("%d\n",&p) 
  } 
  for(i=2,i<p,i++){
     if( n%i==0 ) { 
      flag = 1; 
      break;
}
}

  if( flag==0 ){ 

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

}
  return 0; 

} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |    scanf("%d\n",&p)
      |                    ^
      |                    ;
   10 |   }
      |   ~                 
a.cc:11:18: error: expected ';' before ')' token
   11 |   for(i=2,i<p,i++){
      |                  ^
      |                  ;
a.cc:18:3: error: expected primary-expression before 'if'
   18 |   if( flag==0 ){
      |   ^~
a.cc:16:2: error: expected ';' before 'if'
   16 | }
      |  ^
      |  ;
   17 | 
   18 |   if( flag==0 ){
      |   ~~
a.cc:18:3: error: expected primary-expression before 'if'
   18 |   if( flag==0 ){
      |   ^~
a.cc:16:2: error: expected ')' before 'if'
   16 | }
      |  ^
      |  )
   17 | 
   18 |   if( flag==0 ){
      |   ~~
a.cc:11:6: note: to match this '('
   11 |   for(i=2,i<p,i++){
      |      ^
Language: C++

int main(void) {
	int i,j,n, m[10000],count=0;
	j = 0;

	scanf("%d",&n);
	
	for (i = 0; i < n; i++) scanf("%d",&m[i]);
	while (1) {
		while (1) {
			if (m[j] < 2)
				break;
			else if (m[j] == 2) {
				count++;
				break;
			}

			if (m[j] % 2 == 0)
				break;

			for (i = 3; i <= m[j] / i; i += 2)
				if (m[j] % i == 0)
					break;

			count++;
			break;

		}
		if (j < n)
			j++;
		else
			break;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d",&n);
      |         ^~~~~
a.cc:34:9: error: 'printf' was not declared in this scope
   34 |         printf("%d", count);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void) {
Language: C++

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

int main(){
int i,j,n,x;
scanf("%d",&n);
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf(" ");
}
x=0;
for(i=0;i<n;i++){
   while(j<a[i]){
        if(a[i]%j == 0){
          break;
        }
      x +=1;
    }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'a' was not declared in this scope
   15 |    while(j<a[i]){
      |            ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <stdlib.h>
#include <math.h>
#include <stdio.h>
 
int main(){
int i,j,n,x,y;
scanf("%d",&n);
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf("\n");
}
x = y =0;
for(i=0;i<n;i++){
    for(j=2;j<a[i];j++){
        if(a[i]%j != 0){
           x = 1;
          }
        }
     y += x;
   }
printf("%d\n",y);
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'a' was not declared in this scope
   15 |     for(j=2;j<a[i];j++){
      |               ^
Language: C++

#include <stdlib.h>
#include <math.h>
#include <stdio.h>
 
int main(){
int i,j,n,x,y,z;
scanf("%d",&n);
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf("\n");
}
x = y =0;
for(i=0;i<n;i++){
    z = a[i];
    for(j=2;j<z;j++){
        if(a[i]%j != 0){
           x = 1;
          }
        }
     y += x;
   }
printf("%d\n",y);
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'a' was not declared in this scope
   15 |     z = a[i];
      |         ^
Language: C++

#include <stdlib.h>
#include <math.h>
#include <stdio.h>
 
int main(){
int i,j,n,x,y,z,a[];
scanf("%d",&n);
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf("\n");
}
x = y =0;
for(i=0;i<n;i++){
    for(j=2;j<a[i];j++){
        if(a[i]%j != 0){
           x = 1;
          }
        }
     y += x;
   }
printf("%d\n",y);
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: storage size of 'a' isn't known
    6 | int i,j,n,x,y,z,a[];
      |                 ^
Language: C++

#include <stdlib.h>
#include <math.h>
#include <stdio.h>
 
int main(){
int i,j,n,x,y,z;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf("\n");
}
x = y =0;
for(i=0;i<n;i++){
    for(j=2;j<a[i];j++){
        if(a[i]%j =! 0){
           x = 1;
          }
        }
     y += x;
   }
printf("%d\n",y);
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: lvalue required as left operand of assignment
   17 |         if(a[i]%j =! 0){
      |            ~~~~^~
Language: C++

#include<iostream>
#include<cmath>

#define size 1000;

using namespace std;

bool isprime (int x) {

    int = i;

    if (x == 2) {

        return true;

    }

    if (x < 2 || x % 2) {

        return false;

    }

    for (i = 3; i <= sqrt(x); i += 2) {

        if (n % i) {

            return false;

        }

        return true;

    }

}


}

int main () {

    int n, list[size];
    int count = 0;

    cin >> n;

    for (i = 0; i < n; i++) {

        cin >> list[i];

    }

    for (i = 0; i < n; i++) {

        if (isprime (list[i])) {

            count += 1;

        }

    }

    cout << count << endl;

    return 0;

}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
   10 |     int = i;
      |         ^
a.cc:24:10: error: 'i' was not declared in this scope
   24 |     for (i = 3; i <= sqrt(x); i += 2) {
      |          ^
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>

#define size 1000;

using namespace std;

bool isprime (int x) {

    int i;

    if (x == 2) {

        return true;

    }

    if (x < 2 || x % 2) {

        return false;

    }

    for (i = 3; i <= sqrt(x); i += 2) {

        if (n % i) {

            return false;

        }

        return true;

    }

}


}

int main () {

    int n, list[size];
    int count = 0;

    cin >> n;

    for (i = 0; i < n; i++) {

        cin >> list[i];

    }

    for (i = 0; i < n; i++) {

        if (isprime (list[i])) {

            count += 1;

        }

    }

    cout << count << endl;

    return 0;

}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>

#define size 1000;

using namespace std;

bool isprime (int x) {

    int i;

    if (x == 2) {

        return true;

    }

    if (x < 2 || x % 2) {

        return false;

    }

    for (i = 3; i <= sqrt(x); i += 2) {

        if (n % i == 0) {

            return false;

        }

        return true;

    }

}


}

int main () {

    int n, list[size];
    int count = 0;

    cin >> n;

    for (i = 0; i < n; i++) {

        cin >> list[i];

    }

    for (i = 0; i < n; i++) {

        if (isprime (list[i])) {

            count += 1;

        }

    }

    cout << count << endl;

    return 0;

}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i == 0) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>

#define size 1000;

using namespace std;

bool isprime (int x) {

    int i;

    if (x == 2) {

        return true;

    }

    if (x < 2 || x % 2 == 0) {

        return false;

    }

    for (i = 3; i <= sqrt(x); i += 2) {

        if (n % i == 0) {

            return false;

        }

        return true;

    }

}


}

int main () {

    int n, list[size];
    int count = 0;

    cin >> n;

    for (i = 0; i < n; i++) {

        cin >> list[i];

    }

    for (i = 0; i < n; i++) {

        if (isprime (list[i])) {

            count += 1;

        }

    }

    cout << count << endl;

    return 0;

}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i == 0) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>

#define size = 1000;

using namespace std;

bool isprime (int x) {

    int i;

    if (x == 2) {

        return true;

    }

    if (x < 2 || x % 2 == 0) {

        return false;

    }

    for (i = 3; i <= sqrt(x); i += 2) {

        if (n % i == 0) {

            return false;

        }

        return true;

    }

}


}

int main () {

    int n, list[size];
    int count = 0;

    cin >> n;

    for (i = 0; i < n; i++) {

        cin >> list[i];

    }

    for (i = 0; i < n; i++) {

        if (isprime (list[i])) {

            count += 1;

        }

    }

    cout << count << endl;

    return 0;

}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i == 0) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:14: error: expected primary-expression before '=' token
    4 | #define size = 1000;
      |              ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:4:20: error: expected ']' before ';' token
    4 | #define size = 1000;
      |                    ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:54: error: expected primary-expression before '=' token
   16 |                         if (a[i] % j == 0 || a[i]%2+==0) {
      |                                                      ^
Language: C++

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

int main()
{
	int i, j, n, s;
	double q,x;
	int a[10000];

	scanf("%d", &n);
	s = n;
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (i = 0; i < n; i++) {
                j=0;
		q=sqrt(a[i]);
                x=ceil(q)
		while (j < x) {
			if (a[i] % j == 0 || a[i] % 2 == 0) {
				s--;
				break;
			}
			else {
				j++;
			}
		}
	}
	printf("%d\n", s);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before 'while'
   18 |                 x=ceil(q)
      |                          ^
      |                          ;
   19 |                 while (j < x) {
      |                 ~~~~~
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000
int main()
{
	int i, j,n,s,ary[30];
	bool a[MAX];

	for (i = 0; i < MAX; i++) {
		a[i] = i <= 1 ? false: true;
	}
	for (i = 2; i < sqrt(MAX); i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d", &ary[i]);
	}
	s = 0;
	for (i = 0; i < n; i++) {
		s = s + a[i];
	}
	printf("%d",s);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   19 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

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

int prime(int x)
{

int i;

if(x%2==0)

return 0;

for(i=3;i*i<=x;i+=2){

if(x%i==0)

return 0;

}

return 1;

}

int main()
{

int n,m,i;
int a=0;

scanf("%d",&n);

for(int i=0;i<n;i++)

scanf("%d",&m);

if(prime(m)==1)
{

a++;

}

}

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

return 0;

}

Compiler output:
a.cc:46:7: error: expected constructor, destructor, or type conversion before '(' token
   46 | printf("%d\n",a);
      |       ^
a.cc:48:1: error: expected unqualified-id before 'return'
   48 | return 0;
      | ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

int sosu(int n,int D[])
{
	int i, j, k;
	int l = 1;
	D[0] = 2;
	for (i = 3; i <= n; i += 2)
	{
		k = 0;
		for (j = 3; j <= sqrt(i); j += 2)
		{
			if (i%j == 0)
			{
				k = 1;
				break;
			}
		}

		if (k == 0)
		{
			//printf("%d ", i);
			D[l] = i;
			l = l + 1;
		}
	}
	l = l - 1;
	//printf("total %d", l);
	//printf("\n");

	return l;
}


int main()
{
	int C[10000];
	int D[10000];
	int n;
	int comp = 0;
	//printf_s("??\???????????°????????° ");
	scanf_s(" %d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf_s("%d", &C[i]);
		if (comp < C[i]) {
			comp = C[i];
		}
	}
	int k = sosu(comp, D);
	int kosu = 0;
	//for (int i = 0; i <= k; i++)
	//{
	//	printf_s("%d %d\n", i, D[i]);
	//}


	for (int j = 0; j <= k; j++)
	{
		for (int i = 0; i < n; i++)
		{
		if ((C[i] % D[j]) == 0)
			{
			//printf_s("%d ", D[j]);
				kosu++;
				break;
			}

	}
		
}
		printf_s("%d", kosu);	

	
    
}

Compiler output:
a.cc: In function 'int sosu(int, int*)':
a.cc:9:34: error: 'sqrt' was not declared in this scope
    9 |                 for (j = 3; j <= sqrt(i); j += 2)
      |                                  ^~~~
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf_s' was not declared in this scope
   40 |         scanf_s(" %d", &n);
      |         ^~~~~~~
a.cc:70:17: error: 'printf_s' was not declared in this scope
   70 |                 printf_s("%d", kosu);
      |                 ^~~~~~~~
Language: C++

int sosu(int n,int D[])
{
	int i, j, k;
	int l = 1;
	D[0] = 2;
	for (i = 3; i <= n; i += 2)
	{
		k = 0;
		for (j = 3; j <= sqrt(i); j += 2)
		{
			if (i%j == 0)
			{
				k = 1;
				break;
			}
		}

		if (k == 0)
		{
			//printf("%d ", i);
			D[l] = i;
			l = l + 1;
		}
	}
	l = l - 1;
	//printf("total %d", l);
	//printf("\n");

	return l;
}


int main()
{
	int C[10000];
	int D[10000];
	int n;
	int comp = 0;
	//printf_s("??\???????????°????????° ");
	scanf(" %d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &C[i]);
		if (comp < C[i]) {
			comp = C[i];
		}
	}
	int k = sosu(comp, D);
	int kosu = 0;
	//for (int i = 0; i <= k; i++)
	//{
	//	printf_s("%d %d\n", i, D[i]);
	//}


	for (int j = 0; j <= k; j++)
	{
		for (int i = 0; i < n; i++)
		{
		if ((C[i] % D[j]) == 0)
			{
			//printf_s("%d ", D[j]);
				kosu++;
				break;
			}

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

	
    
}

Compiler output:
a.cc: In function 'int sosu(int, int*)':
a.cc:9:34: error: 'sqrt' was not declared in this scope
    9 |                 for (j = 3; j <= sqrt(i); j += 2)
      |                                  ^~~~
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf' was not declared in this scope
   40 |         scanf(" %d", &n);
      |         ^~~~~
a.cc:70:17: error: 'printf' was not declared in this scope
   70 |                 printf("%d\n", kosu);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int sosu(int n,int D[])
Language: C++

int sosu(int n,int D[])
{
	int i, j, k;
	int l = 1;
	D[0] = 2;
	for (i = 3; i <= n; i += 2)
	{
		k = 0;
		for (j = 3; j <=i/3; j += 2)
		{
			if (i%j == 0)
			{
				k = 1;
				break;
			}
		}

		if (k == 0)
		{
			//printf("%d ", i);
			D[l] = i;
			l = l + 1;
		}
	}
	l = l - 1;
	//printf("total %d", l);
	//printf("\n");

	return l;
}


int main()
{
	int C[10000];
	int D[10000];
	int n;
	int comp = 0;
	//printf_s("??\???????????°????????° ");
	scanf(" %d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &C[i]);
		if (comp < C[i]) {
			comp = C[i];
		}
	}
	int k = sosu(comp, D);
	int kosu = 0;
	//for (int i = 0; i <= k; i++)
	//{
	//	printf_s("%d %d\n", i, D[i]);
	//}


	for (int j = 0; j <= k; j++)
	{
		for (int i = 0; i < n; i++)
		{
		if ((C[i] % D[j]) == 0)
			{
		//printf_s("%d ", D[j]);
				kosu++;
				break;
			}

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

	
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf' was not declared in this scope
   40 |         scanf(" %d", &n);
      |         ^~~~~
a.cc:70:17: error: 'printf' was not declared in this scope
   70 |                 printf("%d\n", kosu);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int sosu(int n,int D[])
Language: C++

int sosu(int n,int D[])
{
	int i, j, k;
	int l = 1;
	D[0] = 2;
	for (i = 3; i <= n; i += 2)
	{
		k = 0;
		for (j = 3; j <=i/3; j += 2)
		{
			if (i%j == 0)
			{
				k = 1;
				break;
			}
		}

		if (k == 0)
		{
			//printf("%d ", i);
			D[l] = i;
			l = l + 1;
		}
	}
	l = l - 1;
	//printf("total %d", l);
	//printf("\n");

	return l;
}


int main()
{
	int C[10000];
	int D[10000];
	int n;
	int comp = 0;
	//printf_s("??\???????????°????????° ");
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf_s("%d", &C[i]);
		if (comp < C[i]) {
			comp = C[i];
		}
	}
	int k = sosu(comp, D);
	int kosu = 0;
	//for (int i = 0; i <= k; i++)
	//{
	//	printf_s("%d %d\n", i, D[i]);
	//}


	for (int j = 0; j <= k; j++)
	{
		for (int i = 0; i < n; i++)
		{
		if ((C[i] % D[j]) == 0)
			{
		//printf_s("%d ", D[j]);
				kosu++;
				break;
			}

	}
		
}
		printf_s("%d\n", kosu);	

	
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf_s' was not declared in this scope
   40 |         scanf_s("%d", &n);
      |         ^~~~~~~
a.cc:70:17: error: 'printf_s' was not declared in this scope
   70 |                 printf_s("%d\n", kosu);
      |                 ^~~~~~~~
Language: C++

int main()
{
	int C[10000];
	
	int n;
	int i, j, k;
	int l = 1;

	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &C[i]);
	}
	int kosu = 0;
	for (int j = 0; j < n; j++)
	{
		if (C[j] == 2)
		{
			kosu = kosu++;
		}
		else
		{
			k = 0;
			for (int l =2; l < C[j]; l ++)
			{
				if (C[j] % l == 0)
				{
					k = 1;
					break;
				}
			}

			if (k == 0)
			{
				kosu++;
			}
		}
	}
		printf("%d\n", kosu);	

	}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%d", &n);
      |         ^~~~~
a.cc:39:17: error: 'printf' was not declared in this scope
   39 |                 printf("%d\n", kosu);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
	double x;
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt(most+1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
	int x;
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt(most+1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
	double x;
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt(most+1);
	for (i = 2; i < (int)x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX],x;
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt(most+1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX],x;
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX],x;
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX],x;
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt((double)most+1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX],x;
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX],x;
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
        double x;
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt((double)most+1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
        double x;
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	x=sqrt((double)most+(double)1);
	for (i = 2; i < x; i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
        double x;
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	//x=sqrt((double)most+(double)1);
	for (i = 2; i < sqrt(most+1); i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
	int i, j,n,s,ary[10000],most=0,s[MAX];
	
	bool a[MAX];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &ary[i]);
        if(ary[i]>most) most=ary[i];
	}
        for (i = 0; i < most+1; i++) {
		a[i] = i >= 2 ? 1:0;
	}
	
	for (i = 2; i < sqrt(most+1); i++) {
		if (a[i]) {
			for (j = 0; i*(j + 2) < MAX; j++) {
				a[i*(j + 2)] = 0;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                                        ^
a.cc:6:20: note: previous declaration as 'int s'
    6 |         int i, j,n,s,ary[10000],most=0,s[MAX];
      |                    ^
Language: C++

#include<iostream>
#include<cmath>
 
#define size 1000;
 
using namespace std;
 
bool isprime (int x) {
 
    int = i;
 
    if (x == 2) {
 
        return true;
 
    }
 
    if (x < 2 || x % 2) {
 
        return false;
 
    }
 
    for (i = 3; i <= sqrt(x); i += 2) {
 
        if (n % i) {
 
            return false;
 
        }
 
        return true;
 
    }
 
}
 
 
}
 
int main () {
 
    int n, list[size];
    int count = 0;
 
    cin >> n;
 
    for (i = 0; i < n; i++) {
 
        cin >> list[i];
 
    }
 
    for (i = 0; i < n; i++) {
 
        if (isprime (list[i])) {
 
            count += 1;
 
        }
 
    }
 
    cout << count << endl;
 
    return 0;
 
}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
   10 |     int = i;
      |         ^
a.cc:24:10: error: 'i' was not declared in this scope
   24 |     for (i = 3; i <= sqrt(x); i += 2) {
      |          ^
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>
 
#define size 1000;
 
using namespace std;
 
bool isprime (int x) {
 
    int = i;
 
    if (x == 2) {
 
        return true;
 
    }
 
    if (x < 2 || x % 2 == 0) {
 
        return false;
 
    }
 
    for (i = 3; i <= sqrt(x); i += 2) {
 
        if (n % i) {
 
            return false;
 
        }
 
        return true;
 
    }
 
}
 
 
}
 
int main () {
 
    int n, list[size];
    int count = 0;
 
    cin >> n;
 
    for (i = 0; i < n; i++) {
 
        cin >> list[i];
 
    }
 
    for (i = 0; i < n; i++) {
 
        if (isprime (list[i])) {
 
            count += 1;
 
        }
 
    }
 
    cout << count << endl;
 
    return 0;
 
}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
   10 |     int = i;
      |         ^
a.cc:24:10: error: 'i' was not declared in this scope
   24 |     for (i = 3; i <= sqrt(x); i += 2) {
      |          ^
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>
 
#define size 1000;
 
using namespace std;
 
bool isprime (int x) {
 
    int = i;
 
    if (x == 2) {
 
        return true;
 
    }
 
    if (x < 2 || x % 2 == 0) {
 
        return false;
 
    }
 
    for (i = 3; i <= sqrt(x); i += 2) {
 
        if (n % i == 0) {
 
            return false;
 
        }
 
        return true;
 
    }
 
}
 
 
}
 
int main () {
 
    int n, list[size];
    int count = 0;
 
    cin >> n;
 
    for (i = 0; i < n; i++) {
 
        cin >> list[i];
 
    }
 
    for (i = 0; i < n; i++) {
 
        if (isprime (list[i])) {
 
            count += 1;
 
        }
 
    }
 
    cout << count << endl;
 
    return 0;
 
}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
   10 |     int = i;
      |         ^
a.cc:24:10: error: 'i' was not declared in this scope
   24 |     for (i = 3; i <= sqrt(x); i += 2) {
      |          ^
a.cc:26:13: error: 'n' was not declared in this scope
   26 |         if (n % i == 0) {
      |             ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:4:18: error: expected ']' before ';' token
    4 | #define size 1000;
      |                  ^
a.cc:43:17: note: in expansion of macro 'size'
   43 |     int n, list[size];
      |                 ^~~~
a.cc:43:21: error: expected primary-expression before ']' token
   43 |     int n, list[size];
      |                     ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:50:16: error: 'list' was not declared in this scope
   50 |         cin >> list[i];
      |                ^~~~
a.cc:3:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    2 | #include<cmath>
  +++ |+#include <list>
    3 | 
a.cc:54:10: error: 'i' was not declared in this scope
   54 |     for (i = 0; i < n; i++) {
      |          ^
a.cc:56:22: error: 'list' was not declared in this scope
   56 |         if (isprime (list[i])) {
      |                      ^~~~
a.cc:56:22: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc: In function 'bool isprime(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^