import java.util.Scanner;
class Day3 {
public static void main(String[] args) {
Scanner season=new Scanner(System.in);
System.out.print("请输入你要查询的月份:");
int input=season.nextInt();
switch (input){
case 1:
case 2:
case 3:
System.out.println("春");
break; //跳出,否则穿透case;
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("输入错误!");
}
}
}
(欢迎纠错!!!!!) |
|