Program HOC24;
var k,i,n: integer;
function nt(x: integer): boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=5;
while j<=trunc(sqrt(x)) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
j:=j+6;
end;
nt:=true;
end;
begin
write('Nhap k : '); readln(k);
write('Nhap N : '); readln(N);
if (k>0) and (k<n) then
begin
write('Cac so nguyen to trong khoang [',k,'..',n,'] la : ');
for i:=k to N do if nt(i) then write(i,' ');
readln
end.
uses crt;
var k,n,i,kt,j:integer;
begin
clrscr;
repeat
write('Nhap k='); readln(k);
write('Nhap n='); readln(n);
until (0<k) and (k<n);
for i:=k to n do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then write(i:4);
end;
readln;
end.