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 ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int tryCount = 3;
- string password = "qwer";
- string userInput;
- Console.WriteLine("Вам нужно угадать пароль что бы увидеть секретное сообщение");
- while (tryCount-- > 0)
- {
- Console.Write("Введите пожалуйста пароль:");
- userInput = Console.ReadLine();
- if(password == userInput)
- {
- Console.WriteLine("Вы видите секретное сообщение");
- }
- else
- {
- Console.WriteLine("Вы ввели не правильный пароль, попробуйте еще раз");
- }
- }
- if(tryCount <=0)
- {
- Console.WriteLine("Вы проиграли.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment