筛选法素数打表

int a[N]={1,1,0};
void isPrime()
{
    for(int i=2;i<N;i++){
        if(!a[i]){
            for(int j=i+i;j<N;j+=i){
                a[j]=1;
            }
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-02-03
相关资源
相似解决方案