using System;
class Program
{
static void Main()
{
// Correct login and password
string correctLogin = "admin";
string correctPassword = "password123";
int attempts = 0;
bool isAuthenticated = false;
do
{
Console.Write("Enter login: ");
string login = Console.ReadLine();
Console.Write("Enter password: ");
string password = Console.ReadLine();
if (login == correctLogin && password == correctPassword)
{
isAuthenticated = true;
Console.WriteLine("Login successful!");
// Additional actions or permissions can be added here
}
else
{
attempts++;
Console.WriteLine("Login failed. Please try again.");
if (attempts >= 3)
{
Console.WriteLine("You have exceeded the maximum number of
attempts.");
break;
}
}
} while (!isAuthenticated);
if (!isAuthenticated)
{
Console.WriteLine("Access denied. Please contact support for
assistance.");
}
}
}