istomina_sofia

(вив)Задание 2

Dec 16th, 2022
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Задание_2
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Here:
  10.             Console.WriteLine("Введите номер дня недели");
  11.             int x = Convert.ToInt32(Console.ReadLine());
  12.  
  13.            
  14.             switch (x)
  15.             {
  16.                 case 1: Console.WriteLine("Понедельник"); goto Here;
  17.                 case 2: Console.WriteLine("Вторник"); goto Here;
  18.                 case 3: Console.WriteLine("Среда"); goto Here;
  19.                 case 4: Console.WriteLine("Четверг"); goto Here;
  20.                 case 5: Console.WriteLine("Пятница"); goto Here;
  21.                 case 6: Console.WriteLine("Суббота"); goto Here;
  22.                 case 7: Console.WriteLine("Воскресенье"); goto Here;
  23.                 default: break;
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment