Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp3
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string sicretMassage = "секрет!";
- string pass = "asdf123";
- int contOfTry = 3;
- int index;
- string userPass = "";
- for (index = 0; index < contOfTry; index++)
- {
- Console.Write($"Введите пароль: ");
- userPass = Console.ReadLine();
- if (userPass == pass)
- {
- Console.WriteLine(sicretMassage);
- break;
- }
- else
- {
- Console.WriteLine("Неверный пароль!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement