-
-
Save tischsoic/b6550e891e95c05ec173 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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