-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatum.java
37 lines (35 loc) · 1.2 KB
/
datum.java
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
import java.io.*;
import java.util.*;
public class datum {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
StringTokenizer st = new StringTokenizer(in.readLine());
int day = Integer.parseInt(st.nextToken());
int month = Integer.parseInt(st.nextToken());
int[] starts = {4, 0, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2};
switch ((starts[month - 1] + day - 1) % 7) {
case 0:
out.println("Sunday");
out.close();
case 1:
out.println("Monday");
out.close();
case 2:
out.println("Tuesday");
out.close();
case 3:
out.println("Wednesday");
out.close();
case 4:
out.println("Thursday");
out.close();
case 5:
out.println("Friday");
out.close();
case 6:
out.println("Saturday");
out.close();
}
}
}