Submission
Status:
PPPPPPPP-P-P-PP-PPPP
Subtask/Task Score:
80/100
Score: 80
User: qwert
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-07 18:45:29
#include <iostream>
using namespace std;
int main()
{
int m,d,arr1[12]={31,28,31,30,31,30,31,11},arr2[6]={31,30,31,30,31,11},s=0,f;
cin>>m>>d;
if(m<8){
for(int i=m-1; i<=7; i++){
s = s + arr1[i];
}
f=s%7;
d=(d+f)%7;
cout<<d;
}
else{
for(int i=m; i>=5; i--){
s = s + arr2[i];
}
f=s%7;
d=(d+f)%7;
cout<<d;
}
}