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("你输入的有误"); } } }
原文地址:http://9815936.blog.51cto.com/9805936/1600339