kwest87

Untitled

Mar 20th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.56 KB | None | 0 0
  1. [StartCode]
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp4
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string command = "вход";
  15.  
  16.             while (command != "выход")
  17.             {
  18.                 Console.WriteLine("Доступные команды : " + "\n" + "Включить свет : свет." + "\n" + "Включить чайник : чайник." + "\n" + "Включить музыку : музыка." + "\n" + "Открыть окно : окно." + "\n" + "Выход из меню : выход.");
  19.                 command = Console.ReadLine();
  20.  
  21.                 switch (command)
  22.                 {
  23.                     case "свет":
  24.                         Console.WriteLine("Свет включился.");
  25.                         break;
  26.                     case "чайник":
  27.                         Console.WriteLine("Чайник закипел.");
  28.                         break;
  29.                     case "музыка":
  30.                         Console.WriteLine("Играет музыка.");
  31.                         break;
  32.                     case "окно":
  33.                         Console.WriteLine("Открылось окно.");
  34.                         break;
  35.                     case "телефон":
  36.                         Console.WriteLine("Можете говорить.");
  37.                         break;
  38.                 }
  39.             }
  40.         }
  41.     }
  42. }
  43. [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment