Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: wleo.lwo
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.004 second
Submitted On: 2025-10-13 20:35:07
#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+day-2)%7;
if(ans==0) ans+=7;
printf("%d",ans);
return 0;
}