Skip to content

Instantly share code, notes, and snippets.

function Prost(inpt: integer): boolean;
var
i: integer;
begin
Prost := true; //initially res of fuck is 1
if inpt < 2 then //there arent prime nums that are less then 2
Prost := false //so if input val is less than 2 then res of fuct is 0
else
for i := 2 to inpt div 2 do //iterante over nums from 2 to half of the input val
if ((inpt mod i) = 0) then //if there isnt any remaind of division input num on present num from iteration