Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main()
- {
- Random r = new Random();
- int titok = r.Next(1, 101), get = 0, proba = 0;
- while( get != titok && proba < 5 )
- {
- Console.Write("\nSzám: ");
- get = int.Parse(Console.ReadLine());
- if( get > titok )
- {
- Console.WriteLine("Kisebb");
- }
- else if( get < titok )
- {
- Console.WriteLine("Nagyobb");
- }
- else if( get == titok )
- {
- Console.WriteLine("Eltaláltad!!");
- break;
- }
- proba++;
- }
- Console.WriteLine("\n\nNem sikerült! :(");
- Console.ReadKey(true);
- }
- }
Add Comment
Please, Sign In to add comment