public static void month(){
System.out.println("请输入1~12月份");
int month=sc.nextInt();
if(month>=2&&month<5){
System.out.println(month+"月份是春天");
}else if(month>=5&&month<8){
System.out.println(month+"月份是夏天");
}else if(month>=8&&month<11){
System.out.println(month+"月份是秋天");
}else if(month==11||month==12||month==1){
System.out.println(month+"月份是冬天");
}else{
System.out.println("输入有误!!");
}
} |
|