Submission
Status:
PPPPPPPPP---PPP-PPPP
Subtask/Task Score:
80/100
Score: 80
User: rice_ot
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-14 09:52:52
#include <bits/stdc++.h>
using namespace std;
int main(){
int d, m; cin>>m>>d;
int month[12+1] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int Wday[7] = {1, 2, 3, 4, 5, 6, 7};
int day = d;
if(m <= 8){
for(int i = m; i<8; i++){
day+=month[i];
}
day+=10;
cout<<Wday[day%7];
}
else{
for(int i = 8; i<m; i++){
day+=month[i];
}
day+=d;
day%=7;
day+=10;
cout<<Wday[(day%7)-1];
}
}