Skip to content

Instantly share code, notes, and snippets.

@tischsoic
Created January 26, 2015 00:07
Show Gist options
  • Save tischsoic/b6550e891e95c05ec173 to your computer and use it in GitHub Desktop.
Save tischsoic/b6550e891e95c05ec173 to your computer and use it in GitHub Desktop.
Program LiczbyDoskonale;
function sumaDzielnikow(i : integer) : integer;
var j : integer;
begin
sumaDzielnikow := 0;
for j := 1 to Round(i/2) do
begin
if (i mod j) = 0 then sumaDzielnikow := sumaDzielnikow + j;
end;
end;
var
i : integer;
begin
for i := 1 to 10000 do if sumaDzielnikow(i) = i then Write(i, ' ');
Readln(i);
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment