Nth prime by debanjan

a[1<<19];x,j;main(i){for(;x<1e4;)if(!a[++i])for(a[++x]=j=i;(j+=i)<2e5;)a[j]=1;for(;gets(&i);printf("%d\n",a[atoi()]));}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page