Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string userInput;
- string cycleEnd = "exit";
- bool repetitions = true;
- while (repetitions)
- {
- Console.Write($"Для выхода из цикла введите - {cycleEnd}\nВведите сообщение: ");
- userInput = Console.ReadLine();
- Console.WriteLine(userInput);
- Console.Clear();
- if (userInput == cycleEnd)
- {
- repetitions = false;
- Console.WriteLine("Выход из цикла.");
- }
- }
- Console.WriteLine("Нажмите любую кнопку для продолжения");
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement