maus234

Untitled

Aug 28th, 2021
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Leson01
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string setName;
  14.             string setSurname;
  15.             string setAge;
  16.             string setPassword;
  17.             string secretPhrase = "1 + 1 = 3";
  18.             string exc;
  19.             string commandUser;
  20.             Console.WriteLine("Видите команду или видите команду /help");
  21.             commandUser = Console.ReadLine();
  22.  
  23.             while (commandUser != "Esc")
  24.             {
  25.                 if (commandUser == "/help")
  26.                 {
  27.                     Console.WriteLine("/Setname - установить свое имя");
  28.                     Console.WriteLine("/Setsurname - установить свою фамилию");
  29.                     Console.WriteLine("/Setage - установить свой возраст");
  30.                     Console.WriteLine("/Setpassword - установить свой пароль");
  31.                     Console.WriteLine("/Showsecretphrase - установить свою секретную фразу");
  32.                     Console.WriteLine("/Esc - выход из программы");
  33.                     Console.WriteLine("Видите команду или видите команду /help");
  34.                     commandUser = Console.ReadLine();
  35.                 }
  36.                 else if (commandUser == "/Setname")
  37.                 {
  38.                     Console.WriteLine("Установите свое имя");
  39.                     setName = Console.ReadLine();
  40.                     Console.WriteLine("Видите команду или видите команду /help");
  41.                     commandUser = Console.ReadLine();
  42.                 }
  43.                 else if (commandUser == "/Setsurname")
  44.                 {
  45.                     Console.WriteLine("Установите свою фамилию");
  46.                     setSurname = Console.ReadLine();
  47.                     Console.WriteLine("Видите команду или видите команду /help");
  48.                     commandUser = Console.ReadLine();
  49.                 }
  50.                 else if (commandUser == "/Setage")
  51.                 {
  52.                     Console.WriteLine("Установите свой возраст");
  53.                     setAge = Console.ReadLine();
  54.                     Console.WriteLine("Видите команду или видите команду /help");
  55.                     commandUser = Console.ReadLine();
  56.                 }
  57.                 if (commandUser == "/Setpassword")
  58.                 {
  59.                     Console.WriteLine("Установите свой пароль");
  60.                     setPassword = Console.ReadLine();
  61.                     Console.WriteLine("Видите команду или видите команду /help");
  62.                     commandUser = Console.ReadLine();
  63.  
  64.                     if (commandUser == "/Showsecretphrase")
  65.                     {
  66.                         if (commandUser == setPassword)
  67.                         {
  68.                             Console.WriteLine("ваша секретная фраза" + secretPhrase);
  69.                         }
  70.                         else
  71.                         {
  72.                             Console.WriteLine("Вы вели неправленый пароль");
  73.                         }
  74.                     }
  75.                 }
  76.                 else if (commandUser == "/Esc")
  77.                 {
  78.                     Console.WriteLine("Установите свой пароль");
  79.                     exc = Console.ReadLine();
  80.                 }
  81.             }
  82.             Console.WriteLine("Вы вышли из программы");
  83.  
  84.         }
  85.     }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment