문제
https://www.acmicpc.net/problem/1924
코드
import java.util.*;
import java.io.*;
class Main {
public static void main(String args[]) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int x = Integer.parseInt(st.nextToken());
int y = Integer.parseInt(st.nextToken());
String[] days = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int n = 0;
for (int i = 0; i < x; i++) {
n += months[i];
}
n += y-1;
System.out.print(days[n%7]);
}
}