[programmers]2016年-練習問題


// 2016년 - 연습문제
public class Year2016 { 

	public String solution(int a, int b) {

		String[] date = { "FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU" };
		int[] day = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

		int temp = 0;
		for (int i = 0; i < a - 1; i++) {
			temp += day[i];
		}
		return date[(temp + b - 1) % date.length];
	}

	public static void main(String[] args) {
		
		Year2016 y = new Year2016();
		System.out.println(y.solution(5, 24));
		
	}
}