Submission

Status:

P-P-P-P----PPPPP---P

Subtask/Task Score:

50/100

Score: 50

User: sakuragichan

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-05 13:52:01

#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-1];
        }
        day += 11;
    }
    else if (m == 8) {
        day += 12 - d;
    }
    else {
        for (int i = m-1; i< 12; ++i) {
            day += list[i-1];
            day += 223;

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