Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleAppWhileExit
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.OutputEncoding = Encoding.UTF8;
- bool isCycleContinue = true;
- string userMessage;
- string exitCycle = "exit";
- while (isCycleContinue)
- {
- Console.WriteLine("Введите слово");
- userMessage = Console.ReadLine();
- if (userMessage != exitCycle)
- {
- Console.WriteLine("Ваш цикл продолжается");
- }
- else
- {
- isCycleContinue = false;
- }
- }
- Console.WriteLine("Ваш цикл закончился! ");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment