var c,a,b,i,j,l:integer;begin cls;
write('Введите через пробел отрезок'); read(a,b); for i:=a to b+1 do begin j:=2; l:=round(sqrt(i)); while (i mod j <> 0) and (j <= l) do begin inc(j); end; if (j > l) then begin write(c,' '); c:=i; end; end;end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var c,a,b,i,j,l:integer;
begin
cls;
write('Введите через пробел отрезок');
read(a,b);
for i:=a to b+1 do
begin
j:=2;
l:=round(sqrt(i));
while (i mod j <> 0) and (j <= l) do
begin
inc(j);
end;
if (j > l) then
begin
write(c,' ');
c:=i;
end;
end;
end.