#include <stdio.h>
int main()
{
int year = 2014;
if(year%4 == 0 && year%100 != 0) || year%400 == 0)
{
printf("%s\n", "今年是闰年");
}
else
{
printf("%s\n", "今年平年");
}
return 0;
}
其实不用打括号的,就像这样也行if(year%4==0&&year%100!=0||year%400==0)
if((year%4 == 0 && year%100 != 0)|| (year%400 == 0))
少了括号