Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp85
- {
- class Program
- {
- static void Main(string[] args)
- {
- string userName = Console.ReadLine();
- string pass = string.Empty;
- for (int i = userName.Length - 1; i >= 0; i--)
- {
- pass += userName[i];
- }
- int count = 1;
- while (true)
- {
- string input = Console.ReadLine();
- if (input == pass)
- {
- Console.WriteLine($"User {userName} logged in.");
- break;
- }
- else if (count == 4)
- {
- Console.WriteLine($"User {userName} blocked!");
- }
- else
- {
- Console.WriteLine("Incorrect password. Try again.");
- }
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement