Wednesday, 22 November 2017

Recap Algo, Chapitre 2



STRUCTURES DE CONTRÔLE ALTERNATIVES
1. action conditionnelle 
Si <condition> Alors <action 1 >
Sinon < action 2 >
fsi ;
ou
Si <condition> Alors <action >
fsi ;
Remarque : On mettra tjrs fsi ; même si le bloc ne contient qu'une seule instruction. Ceci dit, la mise d'un ; avant sinon n'est ni interdite (l'action si n'est pas encore terminée) ni obligatoire (le séparateur sinon suffit).
2. action a choix multiple
Cas <expression 0> parmi
   <expression 1> : <action1> fin;
   <expression 2> : <action2> fin;
   ...
   <expression n> : <action n> fin;
   autrement : <action n+1>
fcas ;
Description : on évalue <expression 0>. Ensuite on évalue les autres expressions dans l'ordre : Si une expression donne la même évaluation que <expression 0>, on execute le bloc d'action correspondant puis on saute jusqu'a fcas. Sinon on passe a l'expression suivante et ainsi de suite. Si aucune expression ne correspond, on execute le bloc <action n+1> s'il existe. 
 

STRUCTURES DE CONTRÔLE RÉPÉTITIVES
1. Tant que :
Tant que <condition > faire
< action > 
ftq ;
2. Pour :
Pour < comp > ← < val_init > jusqu'a < val_finale > faire
< action >
fpour ;
3. Répéter :
Repeter
< action >
Jusqu’a <condition > ;




1 comment:

  1. The Star Grand at The Star Grand at The Star Grand at
    The Star 계룡 출장샵 Grand at 나주 출장마사지 The Star Grand at The Star Grand at The Star Grand at The 천안 출장샵 Star Grand at The 삼척 출장안마 Star Grand at The Star 광주 출장안마 Grand at The Star Grand at The

    ReplyDelete

Note: only a member of this blog may post a comment.