标题: 复习 [打印本页] 作者: 大山的伤 时间: 2016-4-18 22:21 标题: 复习 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("输入错误!");
}
}
}
(欢迎纠错!!!!!)作者: sxyqjdh 时间: 2016-4-18 22:57
复制,黏贴到ECLIPSE作者: 董改名 时间: 2016-4-18 23:03
very good !