자윤이와고리즘/Code
[프로그래머스] 2016년
EUJU
2019. 7. 22. 11:05
#include <string>
#include <vector>
#include <iostream>
using namespace std;
string solution(int a, int b) {
string answer = "";
int value = 0;
vector<int>month{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
vector<string>date {"FRI", "SAT","SUN", "MON", "TUE", "WED", "THU"};
for(int i=0; i <a-1; i++){
value = (value + month[i]% 7) % 7;
}
value =(value+ b % 7 -1)%7;
answer = date[value];
return answer;
}