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