若有定义:float x=1.5;int a=1,b=3,c=2;则正确的switch语句是( )。

admin2011-06-10  18

问题 若有定义:float x=1.5;int a=1,b=3,c=2;则正确的switch语句是(       )。

选项 A、switch(x)
B、switch((int)x);    {case 1.0:printf("*\n");    {case 1:printf("*\n");    case 2.0:printf("**\n");}    case 2:printf("**\n");}
C、switch(a+B)
D、switch(a+B){case 1;printf("*\n");    {case 1:printf("*\n");    case 2+1:printf("**\n");}    case c:printf("**\n");)

答案C

解析
转载请注明原文地址:https://kaotiyun.com/show/X3Pp777K
0

最新回复(0)