Created
August 31, 2025 14:23
-
-
Save Attosius/bf3166fdc90fe2267320c2fee7d81a58 to your computer and use it in GitHub Desktop.
ДЗ: Программа под паролем
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace IJuniorTasks | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var password = "111!!!111"; | |
var secretMessage = "Hi!"; | |
for (int i = 0; i < 3; i++) | |
{ | |
Console.WriteLine("Введите пароль "); | |
var userInput = Console.ReadLine(); | |
if (userInput == password) | |
{ | |
Console.WriteLine($"Секретное сообщение: {secretMessage}"); | |
break; | |
} | |
else | |
{ | |
Console.WriteLine("Пароль неверный!"); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment