package com.task020201;

import java.util.Scanner;

public class Month {

    public static void main(String[] args) {
        int month;
        Scanner in = new Scanner(System.in);
        System.out.println(“请输入月份”);
        month = in.nextInt();
        switch (month) {
        case 12:
        case 10:
        case 8:
        case 7:
        case 5:
        case 3:
        case 2:
            System.out.println(month + “月的天数是31天”);
            break;
        case 1:
            System.out.println(month + “月的天数是28天”);
            break;
        case 4:
        case 6:
        case 9:
            System.out.println(month + “月的天数是30天”);
            break;

        }

    }
}
 


版权声明:本文为hnswzy原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/hnswzy/article/details/123621516