using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PourcentVoy { class Program {/*Énoncé: Écrire un programme qui lit un texte puis calcule le nombre de voyelles dans ce texte et * affiche le pourcentage des voyelles dans ce texte*/ static void Main(string[] args) { string texte; int i, cptVoy = 0; float pourcentage; Console.Write("Donnez-moi votre texte: "); texte = Console.ReadLine(); for (i = 0; i < texte.Length; i++) { if ((texte[i] == 'a') || (texte[i] == 'e') || (texte[i] == 'i') || (texte[i] == 'o') || (texte[i] == 'y') || (texte[i] == 'u')) { cptVoy++; } } pourcentage = (100.0f*cptVoy) / texte.Length; Console.Write("Le pourcentage des voyelles dans le texte : {0} est : {1:0.00} %", texte,pourcentage); Console.Read(); } } }