Created
January 10, 2024 10:07
-
-
Save QRemark/3b07ccf904f4e07472d37149b45d17f0 to your computer and use it in GitHub Desktop.
Контроль выхода
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace homeWork2 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string userInput; | |
Console.Write("Здравствуйте! Введите пожалуйста слово exit, " + | |
"иначе цикл не завершиться: "); | |
userInput = Console.ReadLine(); | |
while (userInput != "exit") | |
{ | |
Console.WriteLine($"Ваше слово {userInput}. Пожалуйста, введите " + | |
"слово exit, иначе цикл не завершиться: "); | |
userInput = Console.ReadLine(); | |
} | |
Console.WriteLine( "Вы ввели слово exit, спасибо! "); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment