Submission
Status:
PPPPPPPPPPPPPPPPP-P-
Subtask/Task Score:
90/100
Score: 90
User: wleo.lwo
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 20:26:21
#include <stdio.h>
#include <string.h>
int main(){
int arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int month,day;
scanf("%d",&month);
scanf("%d",&day);
int i=0,sum=0;
while (month-1+i<12){
sum+=arr[month-1+i];
i++;
}
int ans=sum%7+day-2;
if(ans<0) ans+=7;
printf("%d",ans);
return 0;
}