@betlista NO!! p[i] contains number of primes from 1 to i
for(i=2;i<250;++i) p[i]=1;
for(i=2;i<250;++i){
if(p[i]==1){
for(j=2*i;j<250;j+=i)
p[j]=0;
}
}
p[0]=p[1]=0;
for(i=2;i<250;++i) p[i]+=p[i-1];
Thanks.
@betlista NO!! p[i] contains number of primes from 1 to i
for(i=2;i<250;++i) p[i]=1;
for(i=2;i<250;++i){
if(p[i]==1){
for(j=2*i;j<250;j+=i)
p[j]=0;
}
}
p[0]=p[1]=0;
for(i=2;i<250;++i) p[i]+=p[i-1];
Thanks.
I see, I missed +=
O:-)