Submission
Status:
PPPPPPPPP--P-PPPPPPP
Subtask/Task Score:
85/100
Score: 85
User: letdown
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-07 21:22:33
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
int m, d, daystill = 11, ans;
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 < 7; i++) {
daystill += month[i];
}
} else if (m > 8) {
daystill = 19;
for (int i = 8; i < m-1; i++) {
daystill += month[i];
}
}
cout << (daystill + d-1) % 7 + 1;
}