Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int attempts = 3;
- string rightPassword = "кетчуп";
- string userString;
- Console.WriteLine("Введите пароль:\n");
- do
- {
- userString = Console.ReadLine().ToLower();
- if (userString == rightPassword)
- {
- break;
- }
- else
- {
- Console.WriteLine("Неверный пароль");
- attempts--;
- Console.WriteLine($"У вас осталось {attempts} попыток.");
- }
- }
- while (attempts > 0);
- if (attempts == 0)
- {
- Console.WriteLine("\nВход заблокирован!");
- }
- else
- {
- Console.WriteLine("\nА ты знал, что кетчуп использовался в качестве лекарства в 1930-х годах.");
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment