题目内容:
12.(1分)设: float w; int a, b;则合法的switch语句是( )。
A. switch(w) { case 1.0: printf("*\n"); case 2.0: printf("**\n"); }
B. switchA.; { case 1 printf("*\n"); case 2 printf("**\n");}
C. switchB.{ case 1: printf("*\n"); default: printf("\n"); case 1+2: printf("**\n");}
D. switch(a+b);{ case 1: printf("*\n");case 2: printf("**\n");default: printf("\n");
参考答案: