Advertisement
MaoChessy

Task 13

Oct 24th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace C_sharp_Light
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string password = "qwerty";
  10.             int countOfTry = 3;
  11.             while(countOfTry > 0)
  12.             {
  13.                 Console.Clear();
  14.                 Console.Write("Пароль: ");
  15.                 if (password == Console.ReadLine())
  16.                 {
  17.                     Console.WriteLine("Пароль правильный");
  18.                     Console.WriteLine("Секретное сообщение - Белочка производит туалетную бумагу");
  19.                     Console.ReadKey();
  20.                     break;
  21.                 }
  22.                 else
  23.                 {
  24.                     Console.WriteLine("Пароль  неправильный. Попробуйте ещё раз!");
  25.                     countOfTry--;
  26.                     Console.ReadKey();
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement