手机随手打的
int
isprime(unsigned long long num)
{
if (num < 32) (0xa08a28ac >> num) & 1;
if (!(num&1) || !(num%3)) return 0;
{
unsigned long long walk, end;
int _noname;
end = (unsigned long long)sqrt(mum) & 1;
_noname = end%3;
if (_noname != 1) end += 4 - _noname;
for (walk = 5; walk < end; walk+=6, end-=6)
{
if (!(num%walk) || !(num%(walk+2))
|| !(num%end)
||
!(num%(end-2)) )
return
0;
}
}
return 1;
}