Advertisement
rukvir

HW 2_2_2

Feb 4th, 2025
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HW_2025
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string checkString = "";
  10.             string exitCodeWord = "exit";
  11.             Random random = new Random();
  12.  
  13.             while (checkString != exitCodeWord)
  14.             {
  15.                 Console.WriteLine($"Отгадайте рандомное число или закройте программу написав {exitCodeWord}.");
  16.                 int randomNumber = random.Next(0, 11);
  17.                 Console.WriteLine(randomNumber);
  18.                 Console.WriteLine("Продолжаем?");
  19.                 checkString = Console.ReadLine();
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement