class TestSwitch6 { public static void main(String[] args) { int season=7; switch(season){ case 1: case 2: case 3: System.out.println("春季"); break; case 4: case 5: case 6: System.out.println("夏季"); break; case 7: case 8: case 9: System.out.println("秋季"); break; case 10: case 11: case 12: System.out.println("冬季"); break; default: System.out.println("你输入的有误"); } } }
时间: 2024-11-10 04:24:58