题解 | #KiKi求质数个数#
KiKi求质数个数
https://www.nowcoder.com/practice/d3a404ee0f8d41f98bf4707035d91086
#include <stdio.h> int is_prime(int num){ int i = 2; while(i < num){ if(num % i++ == 0) return 1; } return 0; } int main() { int a = 100; int num = 0; while(a <= 999){ if(!is_prime(a++)) num++; } printf("%d\n", num); return 0; }#悬赏#