Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading.Tasks;
- using System.Threading;
- namespace light
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- int count = 0;
- Console.WriteLine("Введите пароль");
- string p = Console.ReadLine();
- while (p != "1234")
- {
- Console.WriteLine("Вы ввели не правильный пароль");
- p = Console.ReadLine();
- count++;
- if (count >= 4)
- {
- Console.WriteLine("Превышенно количество попыток");
- break;
- }
- }
- if (p == "1234")
- {
- Console.WriteLine("Secret message");
- }
- int count = 0;
- string p = "";
- while ((p = Console.ReadLine()) != "1234")
- {
- count++;
- Console.WriteLine("Пароль введён не верно");
- if (count>=5)
- {
- Console.WriteLine("Превышенно количество попыток");
- break;
- }
- }
- if (p == "1234")
- {
- Console.WriteLine("It's a secret message");
- }
- int count = 0;
- while (count<5)
- {
- string _p = Console.ReadLine();
- if (_p == "1234")
- {
- break;
- }
- else
- {
- count++;
- Console.WriteLine("Вы ввели не правильный пароль");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement