Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: erng

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-09-28 22:07:40

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

int mn[13], d, m, cy=224, cd;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>m>>d;
    mn[1]=31;
    mn[2]=28;
    mn[3]=31;
    mn[4]=30;
    mn[5]=31;
    mn[6]=30;
    mn[7]=31;
    mn[8]=31;
    mn[9]=30;
    mn[10]=31;
    mn[11]=30;
    mn[12]=31;
    for (int i=1; i<m; i++)
    {
        cd=cd+mn[i];
    }
    cd++;
    cy=cy-cd;
    cy=(cy%7+7+d)%7;
    if (cy==0) cout<<"7";
    else cout<<cy;

}