On se propose de calculer $ S=1^2+2^2+3^2+4^2+....+100^2 $
Laquelle des trois propositions suivantes est correcte ?
Dimitri propose l'algorithme suivant :
- Code: Tout sélectionner
S <-- 0
i <-- 0
Tant que (i<100) :
i <-- i+1
S <-- S+i²
Afficher("S=",S)
Eliaquim propose l'algorithme suivant :
- Code: Tout sélectionner
S <-- 1
i <-- 1
Tant que (i<100) :
S <-- S+i²
i <-- i+1
Afficher("S=",S)
Blaise propose l'algorithme suivant :
- Code: Tout sélectionner
S <-- 1
i <-- 0
Tant que (i<100) :
S <-- S+i²
i <-- i+1
Afficher("S=",S)
