-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ1924.java
More file actions
28 lines (26 loc) ยท 969 Bytes
/
Q1924.java
File metadata and controls
28 lines (26 loc) ยท 969 Bytes
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
/**
* Date: 2018. 9. 11.
* Author: inhyuck | https://github.com/inhyuck
* Solution URL: https://github.com/skhucode/skhucode-inhyuck
* Title: 2007๋
* Problem: ์ค๋์ 2007๋
1์ 1์ผ ์์์ผ์ด๋ค.
* ๊ทธ๋ ๋ค๋ฉด 2007๋
x์ y์ผ์ ๋ฌด์จ ์์ผ์ผ๊น? ์ด๋ฅผ ์์๋ด๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
* URL: https://www.acmicpc.net/problem/1924
*/
package io.inhyuck.io;
import java.util.Scanner;
public class Q1924 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = scanner.nextInt();
int y = scanner.nextInt();
int dayCount = 0;
int[] monthCount = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
String[] dayOfWeek = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
for (int i = 1; i < x; i++) {
dayCount += monthCount[i];
}
dayCount += y - 1;
System.out.println(dayOfWeek[dayCount % 7]);
}
}