JulianJulianov

DayOfWeek

Feb 1st, 2020
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _1DayOfWeek
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. var digitFrom1To7 = int.Parse(Console.ReadLine());
  10.  
  11. string[] daysOfTheWeek = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
  12.  
  13. if (digitFrom1To7 >= 1 && digitFrom1To7 <= 7)
  14. {
  15. Console.WriteLine(daysOfTheWeek[digitFrom1To7 - 1]);
  16. }
  17. else
  18. {
  19. Console.WriteLine("Invalid day!");
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment