# include <stdio.h>
int day_of_year (int x,int y,int z);
int main (void)
{
int year,month,day;
printf("请输入你要计算的年月日:");
scanf("%d%d%d",&year,&month,&day);
day=day_of_year (day,month,year);
printf("day=%d\n",day);
return 0;
}
int day_of_year (int x,int y,int z)
{
int leap,k;
int tab[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}};
leap=((z%4==0 && z%100!=0 )||z%400==0);
for(k=1;k<y;k++)
x=x+tab[leap][k];
return x;
}
希望以后写清楚要试验的功能······