Advertisement
maus234

Untitled

Aug 26th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 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 Leson01
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int tryCount = 3;
  15.             string password = "zavod";
  16.             string userInput;
  17.  
  18.             for (int i = 0; i < tryCount; i++)
  19.             {
  20.                 Console.Write("Введите пароль:");
  21.                 userInput = Console.ReadLine();
  22.  
  23.                 if (userInput == password)
  24.                 {
  25.                     Console.WriteLine("Вам открыто секретное слова");
  26.                     Console.WriteLine("Иди работай бездельник");
  27.                 }
  28.                 else
  29.                 {
  30.                     Console.WriteLine("вы вели неправильны пароль, "  + "у вас осталось попыток" + " " + --tryCount);
  31.                 }
  32.             }
  33.  
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement