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 = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
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 |
'하루 한 접시' 카테고리의 다른 글
[백준] 10828번: 스택 [C#] (0) | 2024.05.12 |
---|---|
[백준] 8979번: 올림픽 [C#] (0) | 2024.05.08 |
[백준] 2816번: 디지털 티비 [C#] (0) | 2024.05.06 |
[백준] 1747번: 소수&팰린드롬 [C#] (0) | 2024.04.23 |
[백준] 1100번: 하얀 칸 [Python] (0) | 2024.04.22 |