[Level 1, C++] 2016년


[Level 1, C++] 2016년

시간을 계산해주는 방법을 찾아서 2016년 1월 1일 부터 해당 날짜까지 시간을 계산해서 요일을 구한다. #include #include #include #include using namespace std; string solution(int a, int b) { string answer = ""; time_t start, end; struct tm s_time; int tm_day, tm_hour, tm_min, tm_sec; double diff; string day[7] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" }; s_time.tm_year = 2016 - 1900; s_time.tm_mon = 1 - 1; s_time.tm_mday = 1; s..


원문링크 : [Level 1, C++] 2016년