Skip to content

Instantly share code, notes, and snippets.

@ahmed-bhs
Last active January 28, 2018 10:01
Show Gist options
  • Save ahmed-bhs/a493bee6e536c871302ba2e60eb228c0 to your computer and use it in GitHub Desktop.
Save ahmed-bhs/a493bee6e536c871302ba2e60eb228c0 to your computer and use it in GitHub Desktop.
est_magique
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