Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLight
- {
- public class Program
- {
- static void Main(string[] args)
- {
- const string OutputTextCommandOne = "1";
- const string OutputTextCommandTwo = "2";
- const string OutputRandomNumberCommand = "3";
- const string ClearTextCommand = "4";
- const string ExitProgramCommand = "5";
- Random random = new Random();
- int maxRandomNumber = 10;
- bool isWorking = true;
- while (isWorking)
- {
- Console.WriteLine($"{OutputTextCommandOne})Вывести первый текст.\n{OutputTextCommandTwo})Вывести второй текст.\n{OutputRandomNumberCommand})Сгерерировать число.\n{ClearTextCommand})Очистить консоль.\n{ExitProgramCommand})Выйти из программы.");
- switch (Console.ReadLine())
- {
- case OutputTextCommandOne:
- Console.WriteLine("Hello World!");
- break;
- case OutputTextCommandTwo:
- Console.WriteLine("HHHHEEEEELLLLOOOOO WWOOOOOOOOORLD!!!!!!!!!");
- break;
- case OutputRandomNumberCommand:
- int number = random.Next(maxRandomNumber);
- break;
- case ClearTextCommand:
- Console.Clear();
- break;
- case ExitProgramCommand:
- isWorking = false;
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement