Advertisement
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.Tasks;
- namespace Cslight15
- {
- class Program
- {
- static void Main(string[] args)
- {
- string password, enteredPassword, message;
- bool checkPassword;
- int counter = 0;
- message = "Секретное сообщение";
- Console.Write("Создайте пароль: ");
- password = Console.ReadLine();
- Console.Write("Введите пароль: ");
- while (counter < 5)
- {
- enteredPassword = Console.ReadLine();
- checkPassword = password == enteredPassword;
- if (checkPassword)
- {
- Console.WriteLine(message);
- }
- else if (!checkPassword)
- {
- Console.Write("Повторите попытку: ");
- counter++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement