#include #include #include #include inline bool Judge_LeapYear(int year) { bool flg = false; if (year % 4 == 0) { flg = true; if (year % 100 == 0) { flg = false; if (year % 400 == 0) { flg = true; } } } return(flg); } inline bool Judge_ThirtyFirst(int month) { if (month == 2 || month == 4 || month == 6 || month == 9 || month == 11) { return(false); } return(true); } int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); std::string S; std::cin >> S; int year = 0, month = 0, day = 0; year = std::stoi(S.substr(0, 4)); month = std::stoi(S.substr(5, 2)); day = std::stoi(S.substr(8, 2)); bool flg_leapyear = Judge_LeapYear(year); bool flg_thirty_first = Judge_ThirtyFirst(month); bool over_month = false; switch (day) { case 27: if (month == 2 && flg_leapyear == false) { day = 1; over_month = true; } else { day = 29; } break; case 28: if (month == 2) { if (flg_leapyear) { day = 1; } else { day = 2; } over_month = true; } else { day = 30; } break; case 29: if (month == 2) { day = 2; over_month = true; } else if (flg_thirty_first == false) { day = 1; over_month = true; } else { day = 31; } break; case 30: if (flg_thirty_first == false) { day = 2; } else { day = 1; } over_month = true; break; case 31: day = 2; over_month = true; break; default: day = day + 2; } if (over_month) { if (month == 12) { month = 1; year = year + 1; } else { month = month + 1; } } std::cout << year << '/'; std::cout << std::setw(2) << std::setfill('0') << month << '/'; std::cout << std::setw(2) << std::setfill('0') << day << std::endl; return 0; }