填空题
请补充fun()函数,该函数的功能是:判断一个年份是否为闰年。
例如,1900年不是闰年,2004是闰年。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在fun()函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<conio.h>
int fun(int n)
{
int flag=0;
if(n%4==0)
if(
1)
flag=1;
if(
2)
flag=1;
return
3;
}
void main()
{
int year;
printf("Input the year: ");
scanf("%d", &year);
if(fun(year))
printf("%d is a leap year./n", year);
else
printf("%d is not a leap year./n", year);
}