文章
28
粉丝
226
获赞
53
访问
144.5k
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
for(int i = 1;i <= n;i++){
int y,m,d;
cin >> y >> m >> d;
if((y%4==0 && y%100!=0) || y%400==0){
days[2] = 29;
}else{
days[2] = 28;
}
if(d+1 > days[m]){
m++;
d = 1;
}else{
d++;
}
printf("%4d-%02d-%02d\n", y,m,d);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发