Advertisement
loleckek228

2.8

Aug 10th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _2._8
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Введите пароль");
  10.             string password = Console.ReadLine();
  11.             int countPassword = 0;
  12.             while (countPassword < 5)
  13.             {
  14.  
  15.                 Console.WriteLine("Введите пароль еще раз");
  16.                 string checkPassword = Console.ReadLine();
  17.                 if (password == checkPassword)
  18.                 {
  19.                     Console.WriteLine("Супер секрет");
  20.                     break;
  21.                 }
  22.                 else
  23.                 {
  24.                     if (countPassword < 4)
  25.                     {
  26.                         Console.WriteLine("Пароль введен не верно, попробуйте еще раз");
  27.                         countPassword++;
  28.                     }
  29.                     else
  30.                     {
  31.                         countPassword++;
  32.                     }
  33.                 }
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement