Présentation de l'algorithme :

Triangle de Pascal du rang 2 jusqu'au rang n.

Tester l'algorithme :


(cliquer sur le bouton ci-dessus pour lancer ou relancer l'exécution de l'algorithme)
Remarque : si les messages "Algorithme lancé" et "Algorithme terminé" n'apparaissent pas au bout d'un moment dans la zone ci-dessous, c'est que l'algorithme contient une erreur.

Résultats :

Code de l'algorithme :
1     VARIABLES
2       ligne EST_DU_TYPE LISTE
3       i EST_DU_TYPE NOMBRE
4       j EST_DU_TYPE NOMBRE
5       n EST_DU_TYPE NOMBRE
6       ligne_suivante EST_DU_TYPE LISTE
7     DEBUT_ALGORITHME
8       LIRE n
9       SI (n>=2) ALORS
10        DEBUT_SI
11        ligne[1] PREND_LA_VALEUR 1
12        ligne[2] PREND_LA_VALEUR 1
13        POUR i ALLANT_DE 2 A n
14          DEBUT_POUR
15          ligne_suivante[1] PREND_LA_VALEUR 1
16          AFFICHER ligne_suivante[1]
17          POUR j ALLANT_DE 2 A i
18            DEBUT_POUR
19            ligne_suivante[j] PREND_LA_VALEUR ligne[j-1]+ligne[j]
20            FIN_POUR
21          ligne_suivante[i+1] PREND_LA_VALEUR 1
22          POUR j ALLANT_DE 2 A i+1
23            DEBUT_POUR
24            ligne[j] PREND_LA_VALEUR ligne_suivante[j]
25            AFFICHER " ; "
26            AFFICHER ligne[j]
27            FIN_POUR
28          AFFICHER " "
29          FIN_POUR
30        FIN_SI
31    FIN_ALGORITHME