Skip to content

Instantly share code, notes, and snippets.

@Mazday21
Last active April 17, 2022 17:34
Show Gist options
  • Save Mazday21/391f4dc8c477328dc0c0fe455332ddfd to your computer and use it in GitHub Desktop.
Save Mazday21/391f4dc8c477328dc0c0fe455332ddfd to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
internal class Program
{
static void Main(string[] args)
{
string password = "friend";
string tempWord;
int attempts = 3;
while(attempts > 0)
{
Console.WriteLine($"Скажи, друг, и войди, осталось попыток: {attempts}");
tempWord = Console.ReadLine();
if(tempWord == password)
{
Console.WriteLine("Пароль верен, можете войти");
break;
}
attempts--;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment