Submission
Status:
PPPPPPPPPP-TTPPTPPPP
Subtask/Task Score:
80/100
Score: 80
User: letdown
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 1.092 second
Submitted On: 2025-10-02 20:38:55
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
int m, d, daystill = 12;
cin>>m>>d;
int month[] = {31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31};
if (m <= 8) {
for (int i = m - 1; i < 8; i++) {
daystill += month[i];
}
} else {
for (int i = 11; i <= m; i--) {
daystill += month[i];
}
}
cout << (((daystill + 2) % 7) + d + 1) % 7;
}