Présentation de l'algorithme :
syracuse
Tester l'algorithme :
Graphique :
Code de l'algorithme :
1
VARIABLES
2
s EST_DU_TYPE NOMBRE
3
syracuse EST_DU_TYPE NOMBRE
4
DEBUT_ALGORITHME
5
LIRE syracuse
6
TANT_QUE (syracuse!=1) FAIRE
7
DEBUT_TANT_QUE
8
SI (syracuse%2==0) ALORS
9
DEBUT_SI
10
syracuse PREND_LA_VALEUR syracuse/2
11
AFFICHER "-"
12
AFFICHER syracuse
13
FIN_SI
14
SINON
15
DEBUT_SINON
16
syracuse PREND_LA_VALEUR 3*syracuse+1
17
AFFICHER "-"
18
AFFICHER syracuse
19
FIN_SINON
20
FIN_TANT_QUE
21
FIN_ALGORITHME