Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- namespace CSLight
- {
- class Menu
- {
- static void Main(string[] args)
- {
- string password_1, password_2;
- int attempts = 0;
- Console.Write("Введите пароль: ");
- password_1 = Console.ReadLine();
- for (int i = 0; i < 5; i++)
- {
- Console.Write("\nПовторите пароль: ");
- password_2 = Console.ReadLine();
- if(password_1 != password_2)
- {
- attempts++;
- if(attempts == 5)
- {
- Console.WriteLine("\nДоступ в личный кабинет заблокирован!");
- }
- else
- {
- Console.WriteLine("\nВы не правильно ввели пароль " + attempts + " раз!\n" +
- "При достижении 5 неверных попыток ввода пароля, доступ в личный кабинет будет заблокирован");
- }
- }
- else
- {
- Console.WriteLine("Ты успешно зашел в свой личный кабинет!");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment