把某年某月某天转换为改年的第几天,可为什么我编译后总会有call of nonfunction?是不是我函数调用错了
#include<stdio.h>int year(int y) (判断是否为闰年)
{if(y%4!=0||(y%4==0&&y%100!=0&&y%400!=0))
return 0;
else return 1;
}
int mouth(int m)
{ if(year(m)==0&&m==2)(判断每月天数)
return 28;
if(year(m)!=0&&m==2)
return 29;
if((m<=7&&m%2!=0)||(m>=8&&m%2==0))
return 31;
else
return 30;
}
void main()
{ int year,mouth,day,day1,day2,m;m=0;day2=0;
do
{
printf( " Input year");
scanf("%d",&year);
}while(year<1900||year>3000);
do
{
printf("Input mouth");
scanf("%d",&mouth);
}while(mouth<1||mouth>12);
day2=mouth(m);
do
{ printf("Input day");
scanf("%d",&day);
}while(day<1||day>day2);
if(mouth==1)
day1=day;(如果月份为一,直接等于输入日期)
else if(mouth>1)
{
do
{ day1=mouth(m)+day1;(从一月份开始加,直到等于输入月份)
m++;
}while(m>mouth-1);
day1=day1+day;(再加上最大月份的日期)
}
printf("Is %d",day1);
}
(可是怎么会编译不过的)