Skip to content

Instantly share code, notes, and snippets.

@Attosius
Created August 31, 2025 14:23
Show Gist options
  • Save Attosius/bf3166fdc90fe2267320c2fee7d81a58 to your computer and use it in GitHub Desktop.
Save Attosius/bf3166fdc90fe2267320c2fee7d81a58 to your computer and use it in GitHub Desktop.
ДЗ: Программа под паролем
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