各位帮忙帮我看看基础的C编程问题
/*This is the third C program 第一行*/#include<stdio.h> /*第二行*/
int leap(int year);
int main()
{
int year1,year2;
printf("please input your year:");
scanf("%d%d",&year1,&year2);
if (leap(year1))
printf("%d is leap year\n.",year1);
else
printf("%d is normal year\n.,year1);
if (leap(year2))
printf(%d is leap year\n.,year2);
elsa
printf("%d is normal year\n.,yera2);
}
int leap(int year)
{
int b;
if (year%4==0)
{
if (year%100!=0)
b=1;
else if (year%400==0)
b=1;
else
b=0;
}
Else
b=0;
return(b);
}
D:\VC++\日志\leap.c(31) : error C2146: syntax error : missing ';' before identifier 'b'
执行 cl.exe 时出错.
老是这样,我也觉得没少;啊,求帮忙