function IsPrime(self: integer): boolean; extensionmethod;
begin
Result := true;
if self <= 1 then begin Result := false; exit; end;
for var i := 2 to floor(sqrt(self)) do
if self mod i = 0 then begin result := false; exit; end;
end;
Println(ReadInteger.IsPrime ? 'Да' : 'Нет')
end.
function IsPrime(self: integer): boolean; extensionmethod;
begin
Result := true;
if self <= 1 then begin Result := false; exit; end;
for var i := 2 to floor(sqrt(self)) do
if self mod i = 0 then begin result := false; exit; end;
end;
begin
Println(ReadInteger.IsPrime ? 'Да' : 'Нет')
end.