文章
19
粉丝
98
获赞
3
访问
9.9k
#include <stdio.h>
int main()
{ int y,n;
while(scanf("%d %d",&y,&n) != EOF){
int d,month=1,i=1;
int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if(y%400==0||(y%4==0&&y%100!=0))
mon[2]=29;
for(;i<13;i++)
{n=n-mon[i];
if(n==0)n++;
if(n<0)
break;
}
n=n+mon[i];
printf("%4d-%02d-%02d",y,i,n);}
return 0;
}
登录后发布评论