الجمعة، 18 ديسمبر 2015

'Exercice (fonction MajVoyelle() )'alg


Exercice fonction MajVoyelle() calcule le nombre de voyelles en majuscules d’un mot 


Ecrire une fonction MajVoyelle() qui calcule le nombre de voyelles en majuscules d’un mot 
passé en paramètre.

Example:

Code :
Variable c : Chaîne 
Début 
   Saisir ( c ) 
   Afficher ( "le nombre de voyelle en majuscule de mots '" & c & "' est : " & maju ( c ) ) 
Fin 
Fonction maju ( c : Chaîne ) : Entier 
Variable i , x : Entier 
Variable y : Caractère <- "" 
Début 
   x <- 0 
   i <- 1 
   c <- c & "." 
   Répéter 
        y <- SousChaîne ( c , i , 1 ) 
        Si y = "A" Ou y = "I" Ou y = "E" Ou y = "O" Ou y = "Y" Ou y = "U" Alors 
             x <- x + 1 
        FinSi 
        i <- i + 1 
   Jusqu'à y = "." 
   Retourner ( x ) 
Fin 

Télécharger:









تعليقات الفيس بوك
0 تعليقات البلوجر

ليست هناك تعليقات:

إرسال تعليق