#include <stdio.h>
int main()
{
int year = 2014; //今年是2014年
//补全一下代码
if((year%4==0 &&year100!=0) || year%400==0)
{
printf("%s\n","今年是闰年");
}
else
{
printf("%s\n","今年是平年");
}
return 0;
}
if(year != 2014)
{
printf("%s\n","今年是闰年");
}
else
{
printf("%s\n","今年是平年");
}
return 0;
if的判断出了问题,应该为:if ((year%4==0&&year%100!=0) || (year%400==0))
if((year%4==0 &&year100!=0) || year%400==0)这里year100!=0少了个%
第6行year后面少个"%",下次发代码先选左上角代码语言再发