하루 한 접시

[백준] 1924번: 2007년 [C#]

NaZZU 2024. 5. 7. 23:50

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.IO;
using System.Text;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Security.Cryptography;
 
namespace 연습장
{
    internal class Program
    {
        static StringBuilder sb = new StringBuilder();
        static void Main(string[] args)
        {
            using var reader = new StreamReader(Console.OpenStandardInput());
            using var print = new StreamWriter(Console.OpenStandardOutput());
 
            _1924_boj boj = new _1924_boj();
 
            boj.boj_1924();
 
        }
    }
        internal class _1924_boj
    {
        public void boj_1924()
        {
            int[] Months = { 312831303130313130313031 };
            int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
 
            int days = input[1];
            for (int i = 0; i < input[0- 1; i++)
                days += Months[i];
 
            days %= 7;
            switch(days)
            {
                case 0:
                    Console.WriteLine("SUN");
                    break;
                case 1:
                    Console.WriteLine("MON");
                    break;
                case 2:
                    Console.WriteLine("TUE");
                    break;
                case 3:
                    Console.WriteLine("WED");
                    break;
                case 4:
                    Console.WriteLine("THU");
                    break;
                case 5:
                    Console.WriteLine("FRI");
                    break;
                case 6:
                    Console.WriteLine("SAT");
                    break;
            }
        }
    }
}
 
cs