if(year%4==0&&year%100!=0||year%400==0)
{
printf(“%s\n”,"今年是闰年");
}
else
{
printf("%s\n",“今年是平年”);
}
if((year%4==0&&year%100!=0)||year%400==0)
{
printf(“%s\n”,"今年是闰年");
}
else
{
printf("%s\n",“今年是平年”);
}
你的代码在逻辑与和逻辑或中缺少一个括号if(year%4==0&&year%100!=0||year%400==0)
中if(year%4==0&&year%100!=0)应该用括号括起来if((year%4==0&&year%100!=0)||year%400==0)