#include <iostream.h>
void main()
{
int year;
cout<<"please input a year...";
cin>>year;
if ((year%4==0)&&(year%100!=0)||(year%400==0));
cout<<"The year is leap year.";
else
cout<<"The year isn't leap year.";
}
一个判断闰年的程序,error C2181: illegal else without matching if
执行 cl.exe 时出错.
[此贴子已经被作者于2007-7-17 3:07:25编辑过]