题解 | #KiKi求质数个数#
KiKi求质数个数
http://www.nowcoder.com/practice/d3a404ee0f8d41f98bf4707035d91086
int main()
{
int a = 0;
int d = 0;
int e = 0;
for (int b =100 ; b < 1000; b++)
{
for (int c = 1; c <= b; c++)
{
if (b % c == 0)
{
d++;
if (d > 2)
{
e++;
d = 0;
break;
}
}
}
}
e = 900 - e;
printf("%d\n", e);
return 0;
}