1 câu trả lời
uses crt;
var a:array[1..100]of integer;i,n,x,dem,kt:integer;
begin
clrscr;
write('nhap n='); readln(n);
if n=1 then a[1]:=2else
begin
a[1]:=2;
x:=1;
dem:=1;
repeat
x:=x+2;
kt:=0;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then kt:=1;
if kt=0 then
begin
dem:=dem+1;
a[dem]:=x;
end;
until dem=n;
end;
writeln('so nguyen to thu ',n,' la: ',x);
readln;
end.