Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HomeWork
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- string password = "123";
- string message = "Тайное сообщение!";
- int maxAttempts = 3;
- for (int i = 0; i < maxAttempts; i++)
- {
- Console.WriteLine("Введите пароль: ");
- string userInput = Console.ReadLine();
- if (password == userInput)
- {
- Console.WriteLine();
- Console.WriteLine(message);
- break;
- }
- }
- Console.WriteLine("Вы исчерпали все попытки. Доступ заблокирован.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement