You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
620 B
30 lines
620 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int y, d;
|
|
cin >> y >> d;
|
|
int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
|
//是不是闰年
|
|
if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {
|
|
a[1] = 29;
|
|
}
|
|
int temp = 0;
|
|
if (d < a[0]) {
|
|
cout << 1 << endl;
|
|
cout << d << endl;
|
|
}
|
|
|
|
for (int i = 0; i < 12; i++) {
|
|
temp += a[i];
|
|
if (temp > d) {
|
|
cout << i+1 << endl;
|
|
temp -= a[i];
|
|
cout << d - temp << endl;
|
|
break;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|