ref:wikipedia
bool mark[100001]; //有没有遍历过
int prime[100001];
int primeSize;
void init()
{
primeSize = 0;
for (int i = 2; i <= 100000; i++) //质数因子
{
if (mark[i] == true)continue;
prime[primeSize++] = i;
if (i >= 1000)continue; //终止条件
for (int j = i * i; j <= 100000; j += i)
{
mark[j] = true;
}
}
}