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 TriangleNums
- {
- class Program
- {
- static void Main(string[] args)
- {
- string username = Console.ReadLine();
- string pass = new string(username.Reverse().ToArray());
- string input;
- int counter = 0;
- while (true)
- {
- input = Console.ReadLine();
- if (input!=pass)
- {
- if (++counter>=4)
- {
- Console.WriteLine($"User {username} blocked");
- break;
- }
- Console.WriteLine("Incorrect password. Try again.");
- }
- else
- {
- Console.WriteLine($"User {username} logged in.");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement