Function IsPrime(n:longint):boolean;
var
found:boolean;
p:longint;
begin
if n<4 then IsPrime:=True<br> else begin
found:=(n mod 2=0);
p:=3;
while (not found) and (sqr(p)<=n) do<br> begin found:=(n mod p=0); p+=2 end;
IsPrime:=not found
end
end;
var
a,b,i:longint;
begin
Write('Введите начало и конец интервала: ');
Readln(a,b);
for i:=a to b do
if IsPrime(i) then Write(i,' ');
Writeln
end.