illiden

Password

Nov 25th, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Password
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int tryCount = 3;
  14.             string password = "Ya-unior1820";
  15.             string inputUserPassword;
  16.  
  17.             for (int i = 0; i < tryCount; i++)
  18.             {
  19.                 Console.WriteLine("Введите пароль: ");
  20.                 inputUserPassword = Console.ReadLine();
  21.                 if (inputUserPassword == password)
  22.                 {
  23.                     Console.WriteLine("Секрет. Можно читерить. Там где 100 - всегда победа");
  24.                     break;
  25.                 }
  26.                 else {
  27.                     Console.WriteLine("Пароль не верный. Попробуйте еще раз. Осталось " + (tryCount - i - 1) + " попыток");
  28.                 }
  29.             }
  30.             Console.ReadKey();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment