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

8 lines
156 B
ObjectPascal

function IsPrime(x: integer): boolean;
begin
Result := Range(2,Round(sqrt(x))).All(i->x mod i <> 0)
end;
begin
Range(2,1000).Where(IsPrime).Print;
end.