Nth prime by Debanjan

#define m 999999\x0d
a[m],b[m],x,j;main(i){for(;++i<m;)if(!a[i])for(b[++x]=j=i;(j+=i)<m;)a[j]=1;for(;gets(&i);printf("%d\n",b[atoi()]));}

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

download

return to the top page