Scanner input = new Scanner(System.in);
System.out.println("请输入月:");
int m = input.nextInt();
//switch(char | int | String | byte | short)可以放这些类型
switch (m) {
case 4:
case 6:
case 9:
case 11:
System.out.println("该月有30天");
break;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
System.out.println("该月有31天");
break;
default:
break;
}