Submission

Status:

Compilation Error

Subtask/Task Score:

Score: 0

User: Karatat007

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

Language: cpp

Time: 0.000 second

Submitted On: 2026-09-19 09:46:54

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int dinm[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int m,d;
    cin >> m >> d;

    int total = 0;
    if (m <= 8) {
        for (int i = m - 1; i < 7; i++){
            total += days[i];
        }
    } 
    else{
        for (int i = m - 1; i < 12; i++){ 
            total += days[i];
        }
        for (int i = 0; i < 7; i++){
            total += days[i];
        }
    }
    total += 11;
    cout << (d - 1 + total) % 7 + 1;
}