Advertisement
desislava_topuzakova

02. PASSWORD

Jul 2nd, 2022
2,284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02._Password
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string username = Console.ReadLine();
  10.             string password = Console.ReadLine();
  11.  
  12.             //повтаряме: въвеждаме парола
  13.             //стоп: въведената парола == password
  14.             //продължаваме: въведената парола != password
  15.  
  16.             string enteredPassword = Console.ReadLine();
  17.             while (enteredPassword != password)
  18.             {
  19.                 enteredPassword = Console.ReadLine();
  20.             }
  21.  
  22.             Console.WriteLine($"Welcome {username}!");
  23.  
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement