vector<int> Primrlist()
{
isPrime[0]=isPrime[1]=false;
for(int i=0;i<N;++i)
{
if(isPrime[i]==true)
{
for(int j=2*i;j<=N;j+=i)
isPrime[j]=0;
}
}
return isPrime;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter