#include <iostream>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace Std;
const int maxn=10005;
BOOL VIS[MAXN];
int PRIME[MAXN];
void Make_prime ()//general linear Sieve, there will be repeated sieve, each time the sieve off is a multiple of prime number
{
memset (vis,true,sizeof (VIS));
Vis[0]=vis[1]=false;
int tot=0;
for (int i=2;i<maxn;i++)
{
if (Vis[i])//indicates that I is a prime number
{
Prime[++tot]=i;
for (int j=i*i;j<maxn;j+=i)//will be able to divide this number of sieves off
Vis[j]=false;
}
}
}
void Euler_prime ()//fast linear sieve, each time the sieve off is i* (less than its minimum factor) of composite
{
memset (vis,true,sizeof (VIS));
int tot=0;
for (int i=2;i<maxn;i++)
{
if (vis[i]) prime[tot++]=i;
for (int j=0;j<tot&&prime[j]*i<maxn;j++)//Whether it is a prime number, this step will be
{
Vis[i*prime[j]]=false;
if (i%prime[j]==0) break;//key
}
}
}
int main ()
{
return 0;
}
Two methods of prime sieve