import java.util.Scanner;
class Demo
{
/**
需求:
一年4季,
12个月
*/
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("请问您想知道几月份的季节");
int x = sc.nextInt();
switch (x)
{
case 3:
case 4:
case 5:
System.out.println("亲,春暖花开日");
break;
case 6:
case 7:
case 8:
System.out.println("亲,夏日雨蒙蒙");
break;
case 9:
case 10:
case 11:
System.out.println("亲,秋日踩黄昏");
break;
case 12:
case 1:
case 2:
System.out.println("亲,冬日需进被");
break;
default:
System.out.println("没这个季节,洗洗睡吧");
}
}
}
|
|