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 HomeWorck_2_8_1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string userPassword;
- string mainPassword = "321123";
- string secretMessage = "Ты взломал это ШИФР!!!";
- int hackingAttempts = 3;
- Console.Write("Введите пароль - ");
- for (int counter = 0; counter < hackingAttempts; counter++)
- {
- userPassword = Console.ReadLine();
- if (userPassword == mainPassword){
- Console.WriteLine(secretMessage);
- }
- else{
- Console.WriteLine($"Пароль не верный! Осталось попыток - {hackingAttempts - counter - 1}");
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement