Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _07._Day_of_week
- {
- class Program
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- //1 -> Monday
- //2 -> Tuesday
- //3 -> Wednesday
- //4 -> Thursday
- //5 -> Friday
- //6 -> Saturday
- //7 -> Sunday
- //other -> Error
- //switch -> няколко проверки за точни стойности на една променлива
- switch (number)
- {
- case 1:
- Console.WriteLine("Monday");
- break;
- case 2:
- Console.WriteLine("Tuesday");
- break;
- case 3:
- Console.WriteLine("Wednesday");
- break;
- case 4:
- Console.WriteLine("Thursday");
- break;
- case 5:
- Console.WriteLine("Friday");
- break;
- case 6:
- Console.WriteLine("Saturday");
- break;
- case 7:
- Console.WriteLine("Sunday");
- break;
- default:
- Console.WriteLine("Error");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment