Submission
Status:
P-P-----PP--P-------
Subtask/Task Score:
25/100
Score: 25
User: IKKIWPR
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-08 19:12:54
#include <iostream>
using namespace std;
int main(){
int m , d ; cin >> m >> d;
int day_in_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int diff = 0;
if (m<8){
for (int i= m ; i <8;i++)
diff += day_in_month[i] +10;
}
else if (m==8) diff+=11;
else {
for (int i =8;i<=12;i++) diff+=day_in_month[i];
for (int i =1;i<=8;i++) diff+=day_in_month[i]+11;
}
int ans = diff%7+d;
cout << ans;
return 0;
}