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 passwordTryCount
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int triesCount = 3;
- string password = "12345";
- string inputUser;
- for (int i = 0; i < triesCount; i++)
- {
- Console.WriteLine("Введите пароль ");
- inputUser = Console.ReadLine();
- if (inputUser == password)
- {
- Console.WriteLine("Секретная фраза");
- break;
- }
- else
- {
- Console.WriteLine("Введён неверный пароль");
- Console.WriteLine($"У вас осталось попыток " + (triesCount - i - 1));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement