Home > Back-end >  Can't think out, I am a rookie, a great god save me C
Can't think out, I am a rookie, a great god save me C

Time:05-20

Pray god help novice, problems on the pictures,

CodePudding user response:

Literally baidu a judgment whether the prime function of the ah

CodePudding user response:

To get to 2000000000, print it out, time is a little long, for reference:
 # include & lt; Stdio. H> 

Int main ()

{
Int x, m, n, CNT=0;
Bool flag;
The scanf (" % d ", & amp; N);
For (x=2; X<=n; X++)
{
Flag=true;
For (m=2; M * m<=x; M++)
{
If (x % m==0)
{
Flag=false;
break;
}
}
If (flag==true)
{
Cnt++;
Printf (" % 4 d % c, x, CNT % 5==0? '\ n' : ');
}
}
Printf (" % c % d \ n ", (CNT % 5!=0? B '\ n' : '\'), CNT);

return 0;
}
  • Related