Advertisement
Rodunskiy

Untitled

Apr 9th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. string userInput;
  2.  
  3. while (true)
  4. {
  5.     Console.Write("Введите сообщение:");
  6.     userInput = Console.ReadLine();
  7.  
  8.     if (userInput == "exit")
  9.     {
  10.         Console.WriteLine("Выход из цикла");
  11.         break;
  12.     }
  13.  
  14.     Console.WriteLine(userInput);
  15.     Console.WriteLine("Если хотите закончить цикл введите 'exit'.");
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement