Advertisement
LePetitGlacon

FICHE 6 Exercice 1

Nov 22nd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace o
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.            
  10.             string[] tabNb = new string[10];
  11.             int compteur = 0;
  12.            
  13.             for (int i = 0; i < tabNb.Length;i++)
  14.             {
  15.                 Console.Write("Entrez le {0} nom : ", i+1);
  16.                 string Nom = (Console.ReadLine());
  17.                 if (Nom == "Aubry"){
  18.                     compteur++;
  19.                 }
  20.              
  21.             }
  22.             Console.WriteLine("Il y a {0} noms",tabNb.Length);
  23.             Console.WriteLine("Il y a {0} fois le mots Aubry",compteur);
  24.             Console.ReadKey();
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement