Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pow107 int(pow(10,9) + 7)
#define F(i,x,n) for(int i = x; i < n ; ++i)

bool comp(pair<int, int> a, pair<int, int> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % pow107;
    }
    return f;
}

inline bool pn(long int x){
    if(x <= 1)return false;
    if(x != 2 && x % 2 == 0)
        return false;
    for(int i = 3; i <= (3 + int(sqrt(x)))/2; ++i){
        if((x != i && x % i == 0) || (x != (3 + int(sqrt(x)) - i) && x % (3 + int(sqrt(x)) - i) == 0))
            return false;
    }
    return true;
}

long int factorial(long int n){
    long int f = 1;
    for(long int i = 1; i <= n; ++i){
        f = f * i % pow107;
    }
    return f;
}

long int Func2(long int n,long int m){
    long int s2 = 1,
        r = 1;
    for(long int i = 1; i <= m; ++i){
        s2 = (s2*(n - (i - 1))/i) % (pow107);
    }
    return s2;
}

bool secsort(pair<int, int> a, pair<int, int> b){
    if(a.second == b.second)return a.first > b.first;
    else return a.second > b.second;
}

long int GCD(long int a,long int b){
    if(b == 0)return a;
    return GCD(b,a%b);
}

long int LCM(long int a,long int b){
    return a/GCD(a,b)*b;
}

void warfl(vector<vector<int> > &dist, int n){
  for(int k=0; k<n; k++){
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++){
        dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
      }
    }
  }
  return;
}
//#define long long long

const int MAX = 1000000;
const int MOD = 1e9+7;

long mpow(long x, long n){
    long ans = 1;
    while(n != 0){
        if(n%2==1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n/2;
    }
    return ans;
}

long mfact(long n){
  long ans = 1;
  for(long i=2; i<=n; i++){
    ans = ans*i % MOD;
  }
  return ans;
}

long mcomb(long n, long m){ //aCbをmod計算
    if(n == 0 && m == 0) return 1;
    if(n < m || n < 0) return 0;
    long ans = mfact(n)*mpow(mfact(m), MOD-2) %MOD;
    ans = ans*mpow(mfact(n-m), MOD-2) %MOD;
    return ans;
}

long int jjjjj(long int n){
    long int x = 1;
    for(int i = 1; i <= n; ++i){
        x *=i;
    }
    return x;
}

int main(){
    const int N = 100005;
    bool f[N] = {};
    int c[N] = {};

    for(int i = 0; i <= N, ++i){
        if(!f[i]){
            for(int j = i*2, j <= N, j += i){
                f[j] = !f[j];
            }
        }
    }

    for(int i = 3; i <= N; i += 2){
        if(!f[i] && f[(i + 1)/2])c[i]++;
    }

    for(int i = 3; i <= N; ++i){
        c[i] += c[i - 1];
    }

    int n;
    cin >> n;

    for(int i = 0; i < n; ++i){
        int l,r;
        cin >> l >> r;

        cout << c[r] - c[l - 1] << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:115:31: error: expected ';' before ')' token
  115 |     for(int i = 0; i <= N, ++i){
      |                               ^
      |                               ;
a.cc:117:31: error: expected ';' before '<=' token
  117 |             for(int j = i*2, j <= N, j += i){
      |                               ^~~
      |                               ;
a.cc:117:32: error: expected primary-expression before '<=' token
  117 |             for(int j = i*2, j <= N, j += i){
      |                                ^~
a.cc:117:44: error: expected ';' before ')' token
  117 |             for(int j = i*2, j <= N, j += i){
      |                                            ^
      |                                            ;