摘要:
方法一:简单易懂View Code 1 const int maxn = 10005 ; 2 int prime[ maxn ],shu[ maxn ]; 3 void get_prime(){ 4 for( int i=1;i<maxn;i+=2 ) shu[ i ]=1; 5 for( int i=0;i<maxn;i+=2 ) shu[ i ]=0; 6 shu[ 1 ]=0,shu[ 2 ]=1; 7 for( int i=3;i<maxn;i+=2 ){ 8 if( shu[ i ]==1 ){ 9 int t... 阅读全文