VIzlo

Task 15

Aug 27th, 2022 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | Gaming | 0 0
  1.  int loginAttempts = 3;
  2.             string userPassword = "1234";
  3.             string passwordInput;
  4.  
  5.             Console.WriteLine("Добро пожаловать в систему!");
  6.  
  7.             for (int i = 0; i < loginAttempts; i++)
  8.             {
  9.                 Console.Write("Введите ваш пароль: ");
  10.                 passwordInput = Console.ReadLine();
  11.  
  12.                 if(passwordInput == userPassword)
  13.                 {
  14.                     Console.WriteLine("Пароль верен!");
  15.                     Console.WriteLine("Секретное сообщение: Путин - царь всея руси");
  16.                 }
  17.                 else
  18.                 {
  19.                     Console.WriteLine("Пароль не правильный, попробуйте еще раз!");
  20.                 }
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment