请问如何用c++输出所有的质数

日期:2017-08-06 14:33:58 人气:1

请问如何用c++输出所有的质数

#include using namespace std;const int maxn=10000000;int n, m, prime[maxn], isnt_prime[maxn], tot;void get_prime(int n){ isnt_prime[0]=isnt_prime[1]=1; for (int i=2; i<=n; ++i){ if (!isnt_prime[i]) prime[++tot]=i; for (int j=1; j<
    A+
热门评论