[LeetCode] Count Primes - 素数系列问题

题目概述: Description: Count the number of prime numbers less than a non-negative number, n. 解题方法: 题意是给出n中所有素数的个数。 首先你需要知道判断一个数是不是素数的方法:(最笨方法但有效) bool IsPrime(int n) { if (n<2) { //小于2的数即不是合数也不是素
相关文章
相关标签/搜索