# include" iostream "
# include & lt; stdio.h>
# include & lt; Iomanip>
using namespace std;
Bool judge (int I)
{
Int j;
If (I==2 | | I==3)
return true;
For (j=2; j<=SQRT (I); J++)
{
If (I % j==0)
return false;
}
return true;
}
Int main ()
{
Int the sum, N, I, N_count (0), dn.
cin> N;
for(i=2; i{
{if (judge (I))
{if (judge (I + 2))
N_count + +;
}
}
}
coutsystem("pause");
return 0;
}
Test point a is not correct, can you tell me the procedure where there are holes
CodePudding user response:
Reference:# include & lt; Math. H>
# include & lt; Iostream. H>
//# include & lt; stdio.h>
//# include & lt; Iomanip>
using namespace std;
Bool judge (int I)
{
Int j;
If (i<=3) return i> 1;//if (I==2 | | I==3) return true;
For (j=2; j<=SQRT (I); J++)
{
If (I % j==0)
return false;
}
return true;
}
Int main ()
{
Int the sum, N, I, N_count (0);//dn.
cin> N;
for(i=2; i<=N - 2; I++)//for (I=2; i{
If (judge (I) & amp; & Judge (I + 2)) {
N_count + +;
}
}
coutsystem("pause");
return 0;
}