var month =Number(prompt('请输入一个月份','比如3'));
var smallMonthDay =30;
var bigMonthDay =31;
var leapMonth =28;
switch(month){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
alert(month + '月有' + bigMonthDay +'天')
break;
case 4:
case 5:
case 9:
case 12:
alert(month + '月有' + smallMonthDay + '天')
break;
case 2:
alert(month + '月有' + leapMonth +'天')
break;
default:
alert('输入有误')
break;
}