RedFlys

Home work - command "exit"

Jul 21st, 2021
1,490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HomeWork
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string escCommand = "exit";
  10.             string userInput;
  11.  
  12.             do
  13.             {
  14.                 Console.WriteLine($"Для выхода из программы введите \"{escCommand}\".");
  15.                 userInput = Console.ReadLine();
  16.                 Console.Clear();
  17.             }
  18.             while (escCommand != userInput.ToLower());
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment