题目: Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 分析: 统计所有小于非负整数 n 的质数的数量. 这里使用埃拉托斯特尼筛法.要得到自然数n以内的全部素数,必须把不大于√n的所有素数的倍数剔除,剩…