Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01._Day_Of_Week
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- //[1...7]
- //1 -> Monday
- //2 -> Tuesday
- //3 -> Wednesday
- //4 -> Thursday
- //5 -> Friday
- //6 -> Saturday
- //7 -> Sunday
- // < 1 ΠΈΠ»ΠΈ > 7 -> Invalid day!
- string[] daysOfWeek = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
- if (number < 1 || number > 7)
- {
- Console.WriteLine("Invalid day!");
- }
- else
- {
- //number Π΅ [1; 7]
- Console.WriteLine(daysOfWeek[number - 1]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement