Nth prime by *yuko*

var a:array[0..9999]of word;i,j,k:word;begin
repeat i:=i+1;j:=round(i**0.5);while i mod j>0do
j:=j-1;a[k]:=i;k:=k+1div j until k=9999;repeat
read(i);writeln(a[i])until 0>0end.

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

download

return to the top page