Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Dynamic;
- using System.Linq;
- using System.Runtime.Serialization;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSLight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int tryCount = 3;
- string password = "123456q";
- string userInput;
- for(int i = 0; i < tryCount; i++)
- {
- Console.Write("Введите пароль:");
- userInput = Console.ReadLine();
- if (password == userInput)
- {
- Console.WriteLine("Секрет");
- break;
- }
- else
- {
- Console.WriteLine($"У осталось {tryCount - i -1} попыток");
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment