题解 | #KiKi求质数个数#
KiKi求质数个数
https://www.nowcoder.com/practice/d3a404ee0f8d41f98bf4707035d91086
#include <stdio.h> #include <math.h> int main() { int i=101,j,s=0; while (i<1000) { j=2; while (j<=sqrt(i) ){ if(i%j==0)break; j++; } if (j>sqrt(i))s++; i+=2; } printf("%d",s); return 0; }