Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace p
- {
- class Program
- {
- public static void Main(string[] args)
- {
- Random rnd = new Random();
- int nombreAleatoire = rnd.Next(0, 100);
- int nombre = 0;
- int compteur = 1;
- while (nombre != nombreAleatoire)
- {
- Console.WriteLine("Choisissez un nombre");
- nombre = int.Parse(Console.ReadLine());
- Console.WriteLine("\n{0} essai",compteur);
- if (nombre > nombreAleatoire)
- {
- Console.WriteLine("Le nombre est trop grand :)");
- }
- else
- {
- Console.WriteLine("Le nombre est trop petit :)");
- }
- compteur = compteur + 1;
- }
- Console.WriteLine("\n\n~~~~Bien jouer tu as trouvé :))))))~~~~");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment