#include using namespace std; bool leap(int year) { if (year % 100 == 0 && year % 400 != 0) return false; return year % 4 == 0; } int main() { // Input int y, m, d; scanf("%d/%d/%d", &y, &m, &d); // Calculation int day[13] = {0, 31, leap(y) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; d += 2; if (d > day[m]) { d -= day[m]; ++m; if (m > 12) { m = 1; ++y; } } // Output printf("%02d/%02d/%02d", y, m, d); }