Submission
Status:
PPPPPPPPP-P--PP-PPPP
Subtask/Task Score:
80/100
Score: 80
User: letdown
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-03 19:53:47
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
int m, d, daystill = 12;
cin >> m >> d;
m--;
int ms[] = {31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31};
if (m <= 7) {
for (int i = m; i < 7; i++) {
daystill += ms[i];
}
} else {
daystill = 19;
for (int i = 8; i < m; i++) {
daystill += ms[i];
}
}
cout << (daystill % 7 + d - 1) % 7;
}