Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Velsimir/a83e8b8510ba892f705dfa0309250f61 to your computer and use it in GitHub Desktop.
Save Velsimir/a83e8b8510ba892f705dfa0309250f61 to your computer and use it in GitHub Desktop.
using System;
using System.Security.Policy;
namespace iJunior
{
class MainClass
{
public static void Main(string[] args)
{
string password = "qwerty1234";
string userInput;
string secretSword = "Secret Sword";
int countMax = 3;
for (int i = 1; i <= countMax; i++)
{
Console.Write("Введите пароль: ");
userInput = Console.ReadLine();
if (userInput == password)
{
Console.WriteLine($"Пароль введен верно!\nСекретное слово - {secretSword}");
i = countMax;
}
else
{
int currentCount = countMax - i;
Console.WriteLine($"Пароль введен не верно!\nОстальо попыток - {currentCount}");
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment