Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: FIrmTInn

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-11 21:12:03

#include<iostream>
using namespace std;
int main() {
    int month, day;
    cin >> month >> day;
    int month_day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int total_days_to_add = 0;
    int target_month = 8;
    int target_date = 12; 
    for (int i = month; i < target_month; i++) {
        total_days_to_add += month_day[i];
    }
    total_days_to_add += (target_date - 1);
    int result_day = (day + total_days_to_add);
    result_day = result_day % 7;
    if (result_day == 0) {
        result_day = 7;
    }
    cout << result_day << "\n";
    return 0;
}