Submission
Status:
PPPPP-PPPPPPPPPP--P-
Subtask/Task Score:
80/100
Score: 80
User: wleo.lwo
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 20:27:36
#include <stdio.h>
#include <string.h>
int main(){
int arr[12]={31,28,31,30,31,30,31,31,30,31,30,30};
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-1;
if(ans<0) ans+=7;
printf("%d",ans);
return 0;
}