Advertisement
Rodunskiy

Untitled

May 6th, 2024
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CSLight
  4. {
  5.     public class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string exitWord = "exit";
  10.             string word;
  11.             bool isExit = true;
  12.  
  13.             while (isExit)
  14.             {
  15.                 Console.WriteLine($"Введите любое слово:\nЕсли хотите закончить ввод слов напишите exit {exitWord}");
  16.                 word = Console.ReadLine();
  17.  
  18.                 if (word == exitWord)
  19.                 {
  20.                     isExit = false;
  21.                 }
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement