Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Score: 100
User: Namkhing
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-04-10 22:10:48
#include <bits/stdc++.h>
using namespace std;
const int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
cin.tie(nullptr)->ios_base::sync_with_stdio(false);
int m, d;
cin >> m >> d; m--, d--;
while (m < 7) {
d += day[m];
m++;
}
while (m > 7) {
m--;
d -= day[m];
}
d += 25;
cout << (d % 7 + 7) % 7 + 1;
}