Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Сprogect
- {
- class Program
- {
- static void Main(string[] args)
- {
- string password = "qwerty123";
- string userPassword;
- for (int numberOfAttempts = 0; numberOfAttempts < 3; numberOfAttempts++)
- {
- Console.WriteLine("Введите пароль");
- userPassword = Console.ReadLine();
- if (userPassword == password)
- {
- Console.WriteLine("Тайное сообщение");
- break;
- }
- else
- {
- Console.WriteLine("Пароль неверный. Введите пароль ещё раз");
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement