Submission

Status:

PPPPPPPPP-P--PP-PPPP

Subtask/Task Score:

80/100

Score: 80

User: Phupa

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 09:00:25

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,duan,totalday=0,day;
    int inmonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    cin>>duan;
    if(duan>=8)
    {
        for (i=duan-1;i>8;i--)
        {
            totalday+=inmonth[i];
        }
        totalday+=18;
    }
    else if(duan<8)
    {
        for (i=duan;i<8;i++)
        {
            totalday+=inmonth[i];
        }
        totalday+=11;
    }
    cin>>day;
    day+=totalday%7;
    day=day%7;
    if (day==0)
    {
        day = 7;
    }
    cout<<day;
    return 0;
}