c语言老是出错E:\c++\xy.c(7) : error C2181: illegal else without matching if

日期:2018-03-13 23:37:09 人气:1

c语言老是出错E:\c++\xy.c(7) : error C2181: illegal else without matching if

if(year%4==0&&year%100!=0||year%100==0);if在;的时候就已经结束了。所以下面的else没有相应的if匹配。 建议修改为 if(year%4==0&&year%100!=0||year%100==0){ printf("days=29"); }else { printf("days=28");}
    A+
热门评论