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 Leson01
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfAttempts = 3;
- string password = "zavod";
- string userInput;
- for (int i = 1; i <= numberOfAttempts; i++)
- {
- Console.Write("Введите пароль:");
- userInput = Console.ReadLine();
- if (userInput == password)
- {
- Console.WriteLine("Вам открыто секретное слова");
- Console.WriteLine("Иди работай бездельник");
- }
- else
- {
- Console.WriteLine("вы вели неправильны пароль, у вас осталось попыток" + " " + (numberOfAttempts - i));
- }
- if (i == numberOfAttempts)
- {
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement