Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1.             string password = "123";
  2.             int count = 3;
  3.             for (int i = 0; i <= count; i++)
  4.             {
  5.                 Console.WriteLine("Программа под паролем.Введите пароль: ");
  6.                 string input = Console.ReadLine();
  7.                 if (password == input)
  8.                 {
  9.                     Console.WriteLine("Cекретное сообщение");
  10.                     break;
  11.                 }
  12.                 else
  13.                 {
  14.                     Console.WriteLine("Неверный пароль.Количество попыток: " + (count-i));
  15.                 }
  16.             }
  17.             Console.WriteLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement