Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp60
- {
- class Program
- {
- static void Main()
- {
- string User = Console.ReadLine();
- string password = "";
- int L = User.Length;
- for (int i = L - 1; i >= 0; i--)
- {
- password += User[i];
- }
- int temp = 0;
- while (User != password)
- {
- string testpass = Console.ReadLine();
- if (testpass == password)
- {
- Console.WriteLine($"User {User} logged in.");
- break;
- }
- if(testpass != password)
- {
- temp++;
- if (temp <= 3)
- {
- Console.WriteLine("Incorrect password. Try again.");
- }
- else
- {
- Console.WriteLine("User sunny blocked!");
- }
- }
- }
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement