#include <iostream> using namespace std; int getmonthday(int year,int month) { static int arr[13] = {-1,31,28,31,30,31,30,31,31,30,31,30,31}; if(month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))) { return 29; } return arr[month]; } int main() { int y, n; while (cin >> y >> n) {// 注意 while 处理多个 case int month = 1; int day = 0; day += n; while(day > getmonthday(y,month)) { day -= getmonthday(y, month); month++; if(month == 13) { y++; month = 1; } } printf("%04d-%02d-%02d\n",y,month,day); } } // 64 位输出请用 printf("%lld")