js教程-switcht条件语句
//8号超市生鲜打9折
//18号超市水果打9折
//28号超市文教打9折
//先用上节课的if写
/* var riqi=prompt("请手动输入日期");
if (riqi==8) {
document.write("8号超市生鲜打9折");}
else if (riqi==18) {
document.write("18号超市水果打9折");}
else if (riqi==28) {
document.write("28号超市文教打9折");
} else{
document.write("不打折 ");
var riqi=prompt("请手动输入日期")*1;
switch (riqi){
case 8: document.write("8号超市生鲜打9折");
break;
case 18: document.write("18号超市水果打9折");
break;
case 28: document.write("28号超市文教打9折");
break;
default:
document.write("不打折");
break;
}