SHARE
TWEET

Untitled

a guest May 22nd, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Login
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string username = Console.ReadLine();
  10.             string password = string.Empty;
  11.  
  12.             for (int i = username.Length - 1; i >= 0; i--)
  13.             {
  14.                 password += username[i];
  15.             }
  16.  
  17.             for (int k = 1; k <= 4; k++)
  18.             {
  19.                 string imput = Console.ReadLine();
  20.                 if (k == 4 && imput != password)
  21.                 {
  22.                     Console.WriteLine($"User {username} blocked!");
  23.                     break;
  24.                 }
  25.                
  26.                 if (imput == password)
  27.                 {
  28.                     Console.WriteLine($"User {username} logged in.");
  29.                     break;
  30.                 }
  31.                 else
  32.                 {
  33.                     Console.WriteLine("Incorrect password. Try again.");
  34.                     continue;
  35.                 }
  36.                
  37.             }
  38.         }
  39.     }
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top