Which is the fastest algorithm to find prime numbers?

后端 未结 14 1578
情深已故
情深已故 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:10

    #include
    main()
    {
        long long unsigned x,y,b,z,e,r,c;
        scanf("%llu",&x);
        if(x<2)return 0;
        scanf("%llu",&y);
        if(y0)z=3;
            }
            if(e==0)
            {
                printf("|%llu",z);
                r+=1;
            }
        }
        printf("|\n%llu outputs...\n",r);
        scanf("%llu",&r);
    }    
    

提交回复
热议问题