Last active
January 28, 2018 10:01
-
-
Save ahmed-bhs/a493bee6e536c871302ba2e60eb228c0 to your computer and use it in GitHub Desktop.
est_magique
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 Hell; | |
function est_magique(n:integer): boolean; | |
var | |
a,i,somme,k:integer; | |
b : String; | |
begin | |
somme := 0; | |
for k := 3 to 8 do | |
begin | |
Str(n, b); // n par exemple 21025698 | |
Writeln(b[k]); | |
Val ( b[k], i); | |
somme:=somme+ i; | |
end; | |
If (est_parfait(somme) == n) then result :=true; else result :=false; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment