Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Login
- {
- class Program
- {
- static void Main(string[] args)
- {
- string username = Console.ReadLine();
- string password = "";
- for (int i = username.Length - 1; i >= 0; i--)
- {
- password += username[i];
- }
- for (int i = 0; i < 3; i++)
- {
- string inputPass = Console.ReadLine();
- if (password == inputPass)
- {
- Console.WriteLine($"User {username} logged in.");
- return;
- }
- else
- {
- Console.WriteLine("Incorrect password. Try again.");
- }
- }
- string lastTryPassword = Console.ReadLine();
- if(password == lastTryPassword)
- {
- Console.WriteLine($"User {username} logged in.");
- }
- else
- {
- Console.WriteLine($"User {username} blocked!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement