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