Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shioriiiik/9d4270ef48f36ae1a04989e51b4b7130 to your computer and use it in GitHub Desktop.
Save shioriiiik/9d4270ef48f36ae1a04989e51b4b7130 to your computer and use it in GitHub Desktop.
1.7
using System;
using System.Data;
namespace Variables
{
internal class Program
{
static void Main(string[] args)
{
int triesCount = 3;
string password = "123321";
string userInput;
for (int i = 0; i < triesCount; i++)
{
Console.WriteLine("Введите пароль");
userInput = Console.ReadLine();
if (userInput == password)
{
Console.WriteLine("Момчик на пудже- мета");
break;
}
else
{
Console.WriteLine("Введён неверный пароль");
Console.WriteLine("У вас осталось попыток " + (triesCount - i - 1));
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment