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