#include <stdio.h>
#include <iostream> // string
using namespace std;
int main(){
int x,y, day=0;
string str[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
int last[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
scanf("%d %d", &x, &y);
for(int i=0; i<x-1; i++){
day += last[i]; // sum days from january to before x
}
day += y; // all days from beginning of x to y
cout << str[day%7];
}
[๋ฐฑ์ค(BOJ)] 10818๋ฒ: ์ต์, ์ต๋ (์ ์ถ๋ ฅ, C++) (0) | 2021.02.11 |
---|---|
[๋ฐฑ์ค(BOJ)] 8393๋ฒ: ํฉ (์ ์ถ๋ ฅ, C++) (0) | 2021.02.11 |
[๋ฐฑ์ค(BOJ)] 2739๋ฒ: ๊ตฌ๊ตฌ๋จ (์ ์ถ๋ ฅ, C++) (0) | 2021.02.11 |
[๋ฐฑ์ค(BOJ)] 9095๋ฒ: 1, 2, 3 ๋ํ๊ธฐ (Dynamic Programming, C++) (0) | 2021.02.11 |
[๋ฐฑ์ค(BOJ)] 11727๋ฒ: 2รn ํ์ผ๋ง 2 (Dynamic Programming, C++) (0) | 2021.02.11 |