pascalabcnet/InstallerSamples/LINQ/Linq2.pas
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

14 lines
219 B
ObjectPascal

function IsPrime(x: integer): boolean;
begin
var sqx := Round(Sqrt(x));
var i := 2;
while (i <= sqx) and (x mod i <> 0) do
i += 1;
Result := i > sqx;
end;
begin
Range(2,1000).Where(IsPrime).Print;
end.