Give you a lot of positive integers, just to find out how many prime numbers there are.
Input There are a lot of cases. In each case, there is an integer N representing the number of integers to find. Each integer won’t exceed 32-bit signed integer, and each of them won’t be less than 2.Output For each case, print the number of prime numbers you have found out.Sample Input
32 3 4
Sample Output
2 这是一道素数题。最关键得是我们要通过这道题学会筛选素数的算法。(这提别重要) 毫无疑问这是一道打表题,别问我为什么?这是经验。其实这是有规律的 我把实现筛选素数的算法给出来 #include#include #define N 10000001 int prime[N]; int main() { int i, j; for(i=2; i