文章
2
粉丝
87
获赞
0
访问
1.6k
#include<stdio.h>
int main(){
int i,year,day,num=0,a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
while(scanf("%d%d",&year,&day)!=EOF){
if(year%400==0||(year%4==0&&year%100!=0))
a[1]=29;
else
a[1]=28;
for(i=0;i<12&&day>0;i++){
day=day-a[i];
}
day=day+a[i-1];
printf("%d-%02d-%02d\n",year,i,day); //2位数输出,不足补0:
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发