Advertisement
randomm369

2,8

Aug 25th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 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 _2._8
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите пароль ");
  14.             string password = Console.ReadLine();
  15.             Console.Write("Проверка введенного пароль ");
  16.             string password_Save = Console.ReadLine();
  17.             byte i =5 ;
  18.                  
  19.                 while(i>=0)
  20.             {
  21.  
  22.                 if (password == password_Save)
  23.                 {
  24.                     Console.WriteLine("Вы ввели правильный пароль , секретное слово Троллейбус ");
  25.                     Console.ReadLine();
  26.                     break;
  27.                 }
  28.                 else
  29.                 {
  30.                     if (i == 0)
  31.                         break;
  32.                     Console.Write("Введен неправильный пароль у вас осталось "+i+" попыток ");
  33.                     Console.WriteLine("попробуйте ввести еще ");                    
  34.                     password_Save = Console.ReadLine();
  35.                     i--;
  36.                 }
  37.                                            
  38.                 }
  39.             }
  40.             }
  41.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement