这个是怎么运行了 朋友帮忙解释一下吧!谢谢
程序代码:
#include<stdio.h> void main() { int a=2,b=7,c=5; switch (a>0) { case 1:switch(b<0) { case 1:printf("@");break; case 2:printf("*");break; } case 0:switch(c==5) { case 0:printf("*");break; case 1:printf("#");break; default:printf("#");break; } default :printf("&"); } }朋友帮忙逐句的解释一下吧!这个怎么运行了很是混乱 谢谢!
还有 在组建的时候 出现了
.cpp(7) : warning C4144: '>' : relational expression as switch expression
.cpp(9) : warning C4144: '<' : relational expression as switch expression
.cpp(12) : warning C4808: case '2' is not a valid value for switch condition of type 'bool'
.cpp(14) : warning C4145: '==' : relational expression as switch expression; possible confusion with '='
.cpp(18) : warning C4809: switch statement has redundant 'default' label; all possible 'case' labels are given
.cpp(20) : warning C4809: switch statement has redundant 'default' label; all possible 'case' labels are given
这些事怎么回事 ,但是 下面却是.exe - 0 error(s), 0 warning(s)
谢谢~~