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 ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Здравствуйте, вам пришло секретное сообщение. Для того что бы его увидеть введите пароль: ");
- for(int i = 0; i != 5; i++)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- string pass = Console.ReadLine();
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.BackgroundColor = ConsoleColor.Black;
- if (pass == "csharp")
- {
- Console.WriteLine("Вы выиграли автомобиль, что бы его получить отправьте 100$ на номер 999999999 ");
- break;
- }
- else
- {
- Console.Write("Пароль не верный, у вас осталось {0} попытки, попробуйте еще раз: ", 4 - i);
- }
- if (i == 4)
- {
- return;
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement