文章

37

粉丝

168

获赞

13

访问

268.3k

头像
P1437 解题思路分享
P1437 北京理工大学机试题
发布于2021年3月6日 15:16
阅读数 6.7k

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	int y,m,d;
	cin>>n;
	while(n--){
		cin>>y>>m>>d;
		int f[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
		d=d+1;
		if(d>f[m]){
			d=d-f[m];
			m++;
		}
		printf("%d-%02d-%02d\n",y,m,d);
	}
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发