Exercices - Module M2206 - MMI1
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Manipulation de nombres
Considérons l’algorithme suivant :
Soit un entier naturel A.
Tant que A est différent de 1, exécuter les instructions suivantes :
Si A est impair, alors remplacer A par 3 x A + 1
Sinon remplacer A par A/2
Ajouter A dans un tableau
Retourner le tableau de A
Écrire l'algorithme.
1
2
3
4
5
6
7
8
9
10
function manipulationDeNombre(a) {
return a;
}
// {
module.exports = {
manipulationDeNombre: manipulationDeNombre
};
// }
Press desired key combination and then press ENTER.
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content