特牛生活网

输入月份,输出对应的季节(春夏秋冬)_输入月份,输出对应的季节-CSDN博客

网友收藏
文章浏览阅读6.9k次,点赞4次,收藏4次。1.输入月份,输出对应的季节(春夏秋冬)Scanner input = new Scanner(System.in);System.out.println(“请输入月份:”);int month = input.nextInt();switch (month) {case 1:case 2:case 3:System.out.println(“春”);break;case 4:case 5:case 6:System.out.println(“夏”);break;case 7:_输入月份,输出对应的季节