• 2022-05-27
    设变量已正确定义,选项()与以下程序段不等价。switch(choice){case1:price=3.0;case2:price=2.5;default:price=0.0;}A.price=0.0;B.switch(choice){default:price=0.0;case2:price=2.5;case1:price=3.0;}C.price=0.0;switch(choice){case1:price=3.0;case2:price=2.5;}D.if(choice==1){price=3.0;price=2.5;price=0.0;}elseif(choice==2){price=2.5;price=0.0;}else{price=0.0;}