Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLight
- {
- public class Program
- {
- static void Main(string[] args)
- {
- string password = "12345";
- string secretMessage = "Hello";
- string passwordTry;
- int numberAttempts = 3;
- bool isWorking = true;
- while (isWorking)
- {
- for (int i = 0; i < numberAttempts; i++)
- {
- Console.Write("Введите пароль:");
- passwordTry = Console.ReadLine();
- if (passwordTry == password)
- {
- Console.WriteLine(secretMessage);
- break;
- }
- else
- {
- Console.WriteLine("Неверный пароль!");
- }
- }
- isWorking = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement