Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
#include <cmath>
using namespace std;
bool check(int x){
????????if (x==2) return true;
????????else 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(check(x))count++;
??
????????}
????????cout << count << endl;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |  ^
a.cc:7:3: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |   ^
a.cc:7:4: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |    ^
a.cc:7:5: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |     ^
a.cc:7:6: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |      ^
a.cc:7:7: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |       ^
a.cc:7:8: error: expected primary-expression before '?' token
    7 | ????????if (x==2) return true;
      |        ^
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:7:9: error: expected ':' before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
      |         :
a.cc:7:9: error: expected primary-expression before 'if'
    7 | ????????if (x==2) return true;
      |         ^~
a.cc:8:1: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      | ^
a.cc:8:2: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |  ^
a.cc:8:3: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |   ^
a.cc:8:4: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |    ^
a.cc:8:5: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |     ^
a.cc:8:6: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |      ^
a.cc:8:7: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |       ^
a.cc:8:8: error: expected primary-expression before '?' token
    8 | ????????else if(x<2||x%2==0)return false;
      |        ^
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:8:9: error: expected ':' before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
      |         :
a.cc:8:9: error: expected primary-expression before 'else'
    8 | ????????else if(x<2||x%2==0)return false;
      |         ^~~~
a.cc:9:1: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      | ^
a.cc:9:2: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |  ^
a.cc:9:3: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |   ^
a.cc:9:4: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |    ^
a.cc:9:5: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |     ^
a.cc:9:6: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |      ^
a.cc:9:7: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |       ^
a.cc:9:8: error: expected primary-expression before '?' token
    9 | ????????int i=3;
      |        ^
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:9:9: error: expected ':' before 'int'
    9 | ????????int i=3;
      |         ^~~
      |         :
a.cc:9:9: error: expected primary-expression before 'int'
    9 | ????????int i=3;
      |         ^~~
a.cc:10:1: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      | ^
a.cc:10:2: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |  ^
a.cc:10:3: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |   ^
a.cc:10:4: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |    ^
a.cc:10:5: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |     ^
a.cc:10:6: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |      ^
a.cc:10:7: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |       ^
a.cc:10:8: error: expected primary-expression before '?' token
   10 | ????????while(i <= sqrt(x)){
      |        ^
a.cc:10:9: error: expected primary-expression before 'while'
   10 | ????????while(i <= sqrt(x)){
      |         ^~~~~
a.cc:10:9: error: expected ':' before 'while'
   10 | ????????while(i <= sqrt(x)){
      |         ^~~~~
      |         :
a.cc:10:9: error: expected primary-expression before 'while'
   10 | ????????while(i <= sqrt(x)){
      |         ^~~~~
a.cc:10:9: error: expected ':' before 'while'
   10 | ????????while(i <= sqrt(x)){
      |         ^~~~~
      |         :
a.cc:10:9: error: expected primary-expression before 'while'
   10 | ????????while(i <= sqrt(x)){