Submission
Status:
PPPP----------------
Subtask/Task Score:
20/100
Score: 20
User: Hax
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-12 09:27:29
#include <iostream>
using namespace std;
int main() {
int month[12] = {9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8};
int days[12] = {30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 12};
int m, d;
int totDays = 0;
cin >> m >> d;
int oldM = m;
if (m > 8) {
m -= 8;
}
else {
m += 4;
}
for (int i = m; i < 12; i ++) {
totDays += days[i];
}
cout << totDays % 7 + oldM;
}