Advertisement
Rodunskiy

Untitled

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