|
|||||||||||||||||||||||||||||||||
|
ALGORITHME
D'EUCLIDE pour le calcul du Plus Grand Commun Diviseur Exemple
de présentation d'un algorithme |
|
|
|||||||||||||||||||
|
Rappel
du principe
8 136 = 12 x 678 492 = 12 x 41 On
note la simplicité
On
s'arrête lorsque R est nul. Le
PGCD est égal au B final. Illustration
|
|||||||||||||||||||
|
|
|
|
Organigramme
- Anglais: flow chart
|
|
|
|
|
|
|
||
|
A := 8136: B := 492: C := 1: while C<>0 do C := A mod(B): lprint(A,B,C): A := B: B := C: od: |
le
calcul du modulo: C = A modulo B.
C est différent de 0.
|
|
|
Langage type Mapple |
||
|
|
|||||||||||||||||||||||||
On a bien
|
|||||||||||||||||||||||||
![]()