Submission

Status:

PPPPPPPP---P-PPPPPPP

Subtask/Task Score:

80/100

Score: 80

User: sakuragichan

Problemset: ปฏิทินวันแม่

Language: cpp

Time: 0.002 second

Submitted On: 2026-09-05 13:59:44

#include <iostream>
using namespace std;

int main() {
    int list[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    int d, m ,days , day = 0;
    cin >> m;
    cin >> d;
    if (m < 8) {
        for (int i = m-1; i < 7; ++i) {
            d +=list[i];
        }
        day += 11;
    }
    else if (m == 8) {
        day += 12 - d + 2;
    }
    else {
        for (int i = m-1; i< 12; ++i) {
            day += list[i];
            day += 223;

        }
    }
    days =  ((day % 7)+d) % 7;
    if (days > 0) {
        cout << days;
    }
    else {
        cout << 7;
    }
}