呵呵 我也写一个 大家互相学习
#include <stdio.h>
int Isleapyear(int year)
{
if((year%4==0)&&(year%100!=0)||(year%400==0))
return 1;
else
return 0;
}
int main()
{
int a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int year,month,day,count=0;
int i;
printf("please input the year month and the day\n");
scanf("%d%d%d",&year,&month,&day);
for(i=0;i<month;i++)
count+=a[i];
count+=day;
if(Isleapyear(year))
count--;
printf("%d",count);
}