#include <stdio.h>

int main() {
    
    int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    char week[7][4]={"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    //몇월 몇일
    int x,y;
    scanf("%d %d",&x,&y);
    //x가 1월일때는 더할 일수가 없으니까 빼고 나머지 달은 전 달까지 더함 ex) 3월이면 1,2월 더함
    if (x!=1) {
        for (int i=0; i<x-1; i++) {
            y+=month[i];
        }
    }
    //요일이 7일마다 반복이니까 나눔
    y=y%7;
    printf("%s",week[y]);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: