Advertisement
AlexeySudakov

Untitled

Aug 8th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Threading.Tasks;
  3. using System.Threading;
  4.  
  5. namespace light
  6. {
  7.     class MainClass
  8.     {
  9.         public static void Main(string[] args)
  10.         {
  11.            
  12.             int count = 0;
  13.             Console.WriteLine("Введите пароль");
  14.             string p = Console.ReadLine();
  15.             while (p!="1234")
  16.             {
  17.                 Console.WriteLine("Вы ввели не правильный пароль");
  18.                 p = Console.ReadLine();
  19.                 count++;
  20.                 if (count>=4)
  21.                 {
  22.                     Console.WriteLine("Превышенно количество попыток");
  23.                     break;
  24.                 }
  25.                    
  26.  
  27.             }
  28.  
  29.  
  30.             if (p == "1234")
  31.             {
  32.                 Console.WriteLine("Secret message");    
  33.             }
  34.  
  35.  
  36.  
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement