- class DayDemo
- {
- public static void main(String[] args)
- {
- /* int n=12;
- if(n==3||n==4||n==5)
- System.out.println(n+"春季");
- else if(n==6||n==7||n==8)
- System.out.println(n+"夏季");
- else if(n==9||n==10||n==11)
- System.out.println(n+"秋季");
- else if(n==12||n==1||n==2)
- System.out.println(n+"冬季");
- */
- int x=13;
- if(x>12||x<1)
- System.out.println("月份不存在");
- else if (x>=3&&x<=5)
- System.out.println(x+"春季");
- else if (x>=6&&x<=8)
- System.out.println(x+"夏季");
- else if (x>=9&&x<=11)
- System.out.println(x+"秋季");
- else
- System.out.println(x+"冬季");
- {
- }
- {
- }
- {
- }
复制代码 ---------------------- <a target="blank">ASP.Net+Unity开发</a>、<a target="blank">.Net培训</a>、期待与您交流! ----------------------
详细请查看:<a target="blank">www.itheima.com</a>
|
|