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

8 lines
156 B
ObjectPascal

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