Advertisement
TeT91

ДЗ Контроль выхода

May 7th, 2024 (edited)
618
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 CSLight
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             const string CommandExit = "exit";
  14.  
  15.             bool isFinished = false;
  16.             string userInput;
  17.  
  18.             while (isFinished == false)
  19.             {
  20.                 Console.WriteLine("Введите команду:");
  21.                 userInput = Console.ReadLine();
  22.  
  23.                 if (userInput != CommandExit)
  24.                 {
  25.                     Console.WriteLine($"Выполнена команда {userInput}");
  26.                 }
  27.                 else
  28.                 {
  29.                     isFinished = true;
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement