JAVA/백준

[입출력] 백준 1924

JJunDol2 2021. 7. 30. 12:51

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int m = sc.nextInt();
		int d = sc.nextInt();
		int totaldays = 0;
		int yo = 0;
		
		int[] dayArr = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		String[] yoArr = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
		
		for(int i = 1 ; i < m ; i++) {
			totaldays += dayArr[i];
		}
		totaldays += d;	
		yo = totaldays % 7;
		System.out.println(yoArr[yo]);		
	}
}