1 solutions

  • 0
    @ 2025-9-25 21:40:35

    #include <iostream>
    using namespace std;
    int months[14] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int main() {
        int m, d;
        cin >> m >> d;
        if (d == months[m]) {
            if (m == 12 && d == 31) {
                cout << 1 << ' ' << 1;
            } else {
                cout << m + 1 << ' ' << 1;
            }
        } else {
            cout << m << ' ' << d + 1;
        }
        return 0;
    }
    

    Information

    ID
    5009
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    1
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By