pascalabcnet/_Presentations/2015 New Features/Programs/12_Range - 2.pas
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

19 lines
290 B
ObjectPascal

function IsPrime(x: integer): boolean;
var i: integer;
begin
for i:=2 to Round(sqrt(x)) do
if x mod i = 0 then
begin
IsPrime := False;
exit
end;
IsPrime := True;
end;
var i: integer;
begin
for i:=2 to 1000 do
if IsPrime(i) then
write(i,' ');
end.