Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: FIrmTInn

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-11 21:13:29

#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};
    
    const int target_month = 8;
    const int target_date = 12; 

    int total_days_to_add = 0;

    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 - 1) % 7 + 1;
    
    cout << result_day << "\n";

    return 0;
}