Advertisement
JohnJuly

Homework9

Oct 13th, 2023 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 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 Homework9
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string userInput;
  14.             string exitCommand = "exit";
  15.  
  16.             Console.WriteLine($"Введите любую команду для вывода в консоль, либо введите {exitCommand} для отмены программы!");
  17.             userInput = Console.ReadLine();
  18.  
  19.             while (userInput != exitCommand)
  20.             {
  21.                 userInput = Console.ReadLine() ;
  22.  
  23.                 if(userInput == exitCommand)
  24.                 {
  25.                     Console.WriteLine("Вы отменили выполнение программы!");
  26.                 }
  27.             }
  28.         }
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement