标签:prim set break pre 素数 == sizeof prime ++
memset(check,false,sizeof check); int tot = 0; for(int i = 2;i<=N;++i) { if(!check[i]) prime[tot++] = i; for(int j = 0;j<tot;++j) { if( i * prime[j] > N ) break; check[ i * prime[j] ] = true; if( i % prime[j] == 0 ) break; } }
标签:prim set break pre 素数 == sizeof prime ++
原文地址:https://www.cnblogs.com/akioi/p/12207093.html