Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: erng
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-28 21:15:56
#include <bits/stdc++.h>
using namespace std;
int m,d, mn[14], cd, cy=224, k;
int main()
{
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;
k=(cy%7+d+7)%7;
if (k==0) cout<<7;
else cout<<k;
}