Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Prap
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.003 second
Submitted On: 2026-03-25 13:15:15
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main() {
int D,M;
cin>>M>>D;
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int count = 0;
if (M <= 8) {
for (int i = M-1; i<7; i++) {
count = count + month[i];
}
cout<<(count+D+3)%7+1;
}
else {
for (int i = M-1; i<12; i++) {
count = count + month[i];
}
count = (count + D - 3)%7 + 1;
cout<<count;
}
return 0;
}