C语言多选题
设变量已正确定义,选项()与以下程序段不等价。(2分)switch(choice){case1:price=3.0;case2:price=2.5;default:pri...
设变量已正确定义,选项( )与以下程序段不等价。 (2分)
switch(choice){
case 1: price = 3.0;
case 2: price = 2.5;
default: price = 0.0;
}
A price = 0.0;
B switch(choice){
default: price = 0.0;
case 2: price = 2.5;
case 1: price = 3.0;
}
C price = 0.0;
switch(choice){
case 1: price = 3.0;
case 2: price = 2.5;
}
D if(choice == 1){
price = 3.0; price = 2.5; price = 0.0;
}else if(choice == 2){
price = 2.5; price = 0.0;
}else{
price = 0.0;
} 展开
switch(choice){
case 1: price = 3.0;
case 2: price = 2.5;
default: price = 0.0;
}
A price = 0.0;
B switch(choice){
default: price = 0.0;
case 2: price = 2.5;
case 1: price = 3.0;
}
C price = 0.0;
switch(choice){
case 1: price = 3.0;
case 2: price = 2.5;
}
D if(choice == 1){
price = 3.0; price = 2.5; price = 0.0;
}else if(choice == 2){
price = 2.5; price = 0.0;
}else{
price = 0.0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询