dimanche 16 octobre 2016
    1. Program Parfait;
    2. Var nb, d, som, a, b : integer;
    3. Begin
    4. Repeat
    5. Writeln('donner a et b');
    6. Readln(a,b);
    7. Until (1<a) and (a<b);
    8. For nb:=a To b Do
    9. Begin
    10. som:=0;
    11. For d:=1 To (nb div 2) Do
    12. If (nb mod d = 0) Then som:=som+d;
    13. If nb=som Then Writeln (nb, ' est parfait');
    14. End;
    15. End.

0 commentaires:

Enregistrer un commentaire

Page Facebook

Turbo Pascal 32 bits

Turbo Pascal 64 bits