c语言:illegal else without matching if

日期:2014-01-23 15:50:28 人气:1

c语言:illegal else without matching if

#include int main(){ int x,y; scanf("%d",&x); if(x>=1) y=500; else if(x>=0)//错误提示是没有与else if匹配的if,你把if(x>=1)后的{}去掉就可以了 y=0; else y=-500; printf("%d\n",y); return 0;}
    A+
热门评论