- 生日日数
- 2016-03-26 20:36:28 @
#include<cstdio>
using namespace std;
int dm1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int dm2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int main(void)
{
int y,m,d;
scanf("%d %d %d",&y,&m,&d);
for(int i=1;i<=10000;i++)
{
d++;
if (y%4==0)
{
if(d>dm2[m]){d=1;m+=1;}
else continue;
if(m>12){y++;m=1;}
else continue;
}
else
{
if (d>dm1[m]){d=1;m+=1;}
else;
if(m>12) {y++;m=1;}
else continue;
}
}
printf("%d-%d-%d\n",y,m,d);
return 0;
}
0 条评论
目前还没有评论...