#include <stdio.h>
void main()
{
printf("please input the date(including the month, the day and the year\n");
int a,b,c,sum;
scanf("%d %d %d",&a,&b,&c);
if(b<=31)
{
if((c%400==0)||(c%4==0&&c%100!=0))
{
switch(a)
{
case 1:sum=b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 2:sum=31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 3:sum=31+29+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 4:sum=31+29+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 5:sum=31+29+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 6:sum=31+28+31+30+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 7:sum=31+29+31+30+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 8:sum=31+29+31+30+31+30+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 9:sum=31+29+31+30+31+30+31+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 10:sum=31+29+31+30+31+30+31+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 11:sum=31+29+31+30+31+30+31+31+30+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 12:sum=31+29+31+30+31+30+31+31+30+30+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
default: printf("the date you input is wrong\n");
}
}
else
switch(a)
{
case 1:sum=b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 2:sum=31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 3:sum=31+28+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 4:sum=31+28+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 5:sum=31+28+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 6:sum=31+28+31+30+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 7:sum=31+28+31+30+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 8:sum=31+28+31+30+31+30+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 9:sum=31+28+31+30+31+30+31+31+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 10:sum=31+28+31+30+31+30+31+31+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 11:sum=31+28+31+30+31+30+31+31+30+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
case 12:sum=31+28+31+30+31+30+31+31+30+30+30+b;printf("输入的日期为%d的年的第%d天",c,sum);break;
default: printf("the date you input is wrong\n");
}
}
else
printf("the date you input is wrong\n");
}