Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace C_Ijun
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string passwordForMessage = "i'll be back";
- string userMessage;
- int tryCount = 3;
- for (int i = 1; i <= tryCount; i++)
- {
- Console.Write("Введите пароль: ");
- userMessage = Console.ReadLine();
- if (passwordForMessage == userMessage)
- {
- Console.WriteLine("Всё в порядке! Свои.");
- break;
- }
- else
- {
- Console.WriteLine($"Не верно, осталось {tryCount - i} попыток.");
- }
- }
- Console.WriteLine("Это конец...");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement