Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ucheba_sharp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- string password = "1111";
- int attempt = 3;
- string input;
- for(int i=1; i<=attempt; i++)
- {
- Console.WriteLine("Введите пароль");
- input = Console.ReadLine();
- if (input == password)
- {
- Console.WriteLine("СЕКРЕТНОЕ СЛОВО");
- Console.ReadKey();
- break;
- }
- else
- {
- Console.WriteLine($"Неверно. У вас осталось {attempt-i} попыток");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement