Submission

Status:

P-PP-------P---P-P--

Subtask/Task Score:

30/100

Score: 30

User: Nasmo

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-27 18:20:07

#include <iostream>
using namespace std;

int main() {
    int m, d;
    cin >> m >> d;

    int total = d;

    for (int i = 1; i < m; i++) {
        if (i == 2)
            total += 28;
        else if (i == 4 || i == 6 || i == 9 || i == 11)
            total += 30;
        else
            total += 31;
    }

    int day = (total - 1) % 7 + 1;

    cout << day;

    return 0;
}