fonction Mystere (val n,b : entiers) : entier
debut
si ( n<b ) alors
retourner ( n );
sinon
retourner ( 10 * Mystere (n/b,b) + Modulo (n,b) );
fin si
fin;
La fonction Modulo(val a,b:entiers):entier retourne le reste de la division entière de
a par b.
fonction monotonie(ref T:tableau[1..n] d'entier,indice:entier):entier;
var i, j, taille;
debut
i := 1; taille := 1; indice := 1;
tant que i < n faire
j := i+1;
tant que j <= n et T[j-1] <= T[j] faire
j := j+1;
fin tantque
si j - i > taille alors
taille := j-i;
indice := i;
finsi
i := j;
fin tantque
retourner(taille);
fin