Which is the fastest algorithm to find prime numbers?

后端 未结 14 1429
情深已故
情深已故 2020-11-22 06:49

Which is the fastest algorithm to find out prime numbers using C++? I have used sieve\'s algorithm but I still want it to be faster!

14条回答
  •  不思量自难忘°
    2020-11-22 07:00

    #include
    using namespace std;
    
    void main()
    {
        int num,i,j,prime;
        cout<<"Enter the upper limit :";
        cin>>num;
    
        cout<<"Prime numbers till "<

提交回复
热议问题