Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.3.8.1.2 Сделайте счётчик неверных вводов пароля, и при достижение числа 5, завершите программу
- public static void Main(string[] args)
- { string password = "закатун";
- int countPass = 5;
- do
- {
- Console.Clear();
- Console.WriteLine("Введите пароль... Попыток: {0}", countPass);
- }
- while(password != Console.ReadLine() && --countPass > 0);
- if(countPass == 0){
- Console.Clear();
- Console.WriteLine("Попыток ввода пароля {0} Окно будет закрыто.", countPass);
- Console.ReadKey();
- return;
- }
- Console.WriteLine("Ты познал Кузинатару!");
- Console.ReadKey();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement