Advertisement
Briotar

Homework 2

Apr 29th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Homework2._2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string password = "somesecretkey";
  10.             string userInput = "";
  11.             int countTry = 3;
  12.  
  13.             while ((userInput != password) && (countTry > 0))
  14.             {
  15.                 Console.WriteLine("Введите пароль:");
  16.                 userInput = Console.ReadLine();
  17.                 countTry -= 1;
  18.             }
  19.  
  20.             if (userInput == password)
  21.             {
  22.                 Console.WriteLine("somesecretmessadge");
  23.             }
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement