Askor

Hw8

Jun 30th, 2020 (edited)
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CSLight1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string message;
  10.             string exitProgram = "exit";
  11.  
  12.             do
  13.             {
  14.                 Console.WriteLine("Введите текст сообщения. Чтобы выйти из программы наберите - exit");
  15.                 message = Console.ReadLine();
  16.                 Console.WriteLine($"Вы ввели: {message}");
  17.  
  18.                 if (message == exitProgram)
  19.                 {
  20.                     Console.WriteLine("Вы завершили программу.");
  21.                     break;
  22.                 }
  23.             }while(message != exitProgram)
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment