Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Pravki
- {
- class Program
- {
- static void Main(string[] args)
- {
- string password = "somesecretkey";
- string userInput = "";
- int countTry = 3;
- for(int i = 0; i < countTry; i++)
- {
- Console.WriteLine("Введите пароль:");
- userInput = Console.ReadLine();
- if (userInput == password)
- {
- Console.WriteLine("somesecretmessadge");
- break;
- }
- else
- {
- Console.WriteLine($"У вас осталось {countTry - i - 1} попыток");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement