Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- string password = "WfhUf58WeyfVb27";
- int numberAttems = 3;
- for (int i = 1; i <= numberAttems; i++)
- {
- Console.Write("Введите пароль:");
- string userInput = Console.ReadLine();
- if (userInput == password)
- {
- Console.WriteLine("Введень верный пароль.");
- break;
- }
- else
- {
- Console.WriteLine($"Вы ввели неверный пароль. Осталось {numberAttems - i} попыток.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement