NikaBang

ДЗ: Контроль выхода

Oct 6th, 2025
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | Gaming | 0 0
  1. internal class Program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         string stopWord = "exit";
  6.         bool isWork = true;
  7.  
  8.         while (isWork)
  9.         {
  10.             Console.Write("еще не вышел? ");
  11.             string userInput = Console.ReadLine();
  12.  
  13.             if (userInput == stopWord)
  14.             {
  15.                 isWork = false;
  16.             }
  17.         }
  18.  
  19.         Console.WriteLine("Ура!");
  20.         Console.ReadKey();
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment