Submission
Status:
P-PPP-PPPP---PP---P-
Score: 55
User: krittaphot
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2024-10-11 21:15:09
#include <stdio.h>
int main()
{
int m;
int d;
int total = 0;
scanf("%d%d",&m,&d);
switch(m){
case 12:
total = total+31;
case 11:
total = total+30;
case 10:
total = total+31;
case 9:
total = total+30;
case 1:
total = total+31;
case 2:
total = total+28;
case 3:
total = total+31;
case 4:
total = total+30;
case 5:
total = total+31;
case 6:
total = total+30;
case 7:
total = total+31;
case 8:
total = total+12;
break;
}
int y = (total-1)%7;
printf("%d",d+y);
}