-
Notifications
You must be signed in to change notification settings - Fork 15
/
datum.cs
34 lines (33 loc) · 1.02 KB
/
datum.cs
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
using System;
public class datum {
public static void Main (string[] args) {
string line = Console.ReadLine ();
int space = line.IndexOf (' ');
int day = int.Parse (line.Substring (0, space));
int month = int.Parse (line.Substring (space + 1));
for (int x = 1; x < month; x++) {
switch (x) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
day += 31;
break;
case 2:
day += 28;
break;
case 4:
case 6:
case 9:
case 11:
day += 30;
break;
}
}
day %= 7;
Console.WriteLine (day == 0 ? "Wednesday" : day == 1 ? "Thursday" : day == 2 ? "Friday" : day == 3 ? "Saturday" : day == 4 ? "Sunday" : day == 5 ? "Monday" : "Tuesday");
}
}