問題一:switch里可以寫for循環(huán)嗎?像這樣:var?myweek?=xxxxxx;//myweek表示星期幾變量
switch(myweek)
{
?case?1:
?case?2:
?for()
???{
???document.write("aaaaaaaa");
???}
break;
case?3:
case?4:?
??for()
???{
???document.write("bbbbbbbb");
???}
break;???
case?5:
case?6:
??for()
???{
???document.write("ccccccc");
???}
default:
??for()
???{
???document.write("dddddddd");
???}
}問題二case 1:case 2:的意思是同時滿足case 1 和case 2嗎?
switch語句可以和for循環(huán)一起用嗎?
阿爾濱必勝
2015-06-04 10:56:38