Advertisement
sergezhu

Untitled

Apr 5th, 2023
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. namespace ConsoleApp1;
  2.  
  3. using System.Text;
  4.  
  5. public class Task09
  6. {
  7.     public void Run()
  8.     {
  9.         Console.InputEncoding = Encoding.Unicode;
  10.         Console.OutputEncoding = Encoding.Unicode;
  11.  
  12.         bool canExit = false;
  13.  
  14.         while ( !canExit )
  15.         {
  16.             Console.WriteLine( $"Program is working..." );
  17.  
  18.             string properlyExitAnswer = "exit";
  19.            
  20.             Console.WriteLine( $"Continue? Enter \'{properlyExitAnswer}\' for exit" );
  21.             string continueAnswer = Console.ReadLine();
  22.  
  23.             canExit = string.Equals( continueAnswer, properlyExitAnswer );
  24.         }
  25.     }
  26. }
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement