0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 19:16:27 +00:00
OI-codes/Luogu/P5690/P5690.cpp

42 lines
912 B
C++
Raw Normal View History

2020-12-03 00:45:16 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
int m, d, t, ans = 0;
scanf("%d-%d", &m, &d);
if (1 <= m && m <= 12) {
if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
t = 31;
2021-11-19 09:01:13 +00:00
} else if (m == 2) {
2020-12-03 00:45:16 +00:00
t = 28;
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
t = 30;
}
if (1 <= d && d <= t) {
ans = 0;
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
ans = 1;
}
2021-11-19 09:01:13 +00:00
} else if (12 < m && m < 20) {
2020-12-03 00:45:16 +00:00
if (1 <= d && d <= 31) {
ans = 1;
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
ans = 2;
}
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
if (m % 10 == 1 || m % 10 == 2 || m % 10 == 3 || m % 10 == 5 || m % 10 == 7 || m % 10 == 8) {
t = 31;
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
t = 30;
}
if (1 <= d && d <= t) {
ans = 1;
2021-11-19 09:01:13 +00:00
} else {
2020-12-03 00:45:16 +00:00
ans = 2;
}
}
printf("%d\n", ans);
return 0;
}