import java.util.Scanner; public class Liuhanxiao3{ public static void main(String[] args){int month;//boolean a;Scanner sc=new Scanner(System.in);//Scanner sx=new Scanner(System.in);System.out.print("请输入一个1到12的值:");//System.out.print("请输入是否为闰年:");month=sc.nextInt;//a=sx.nextBoolean;switch(month){case 1: System.out.println("一月份为31天"); break;case 2: System.out.println("二月份为28天"); break;case 3: System.out.println("三月份为31天"); break;case 4: System.out.println("四月份为30天"); break;case 5: System.out.println("五月份为31天"); break;case 6: System.out.println("六月份为30天"); break;case 7: System.out.println("七月份为31天"); break;case 8: System.out.println("八月份为31天"); break;case 9: System.out.println("九月份为30天"); break;case 10: System.out.println("十月份为31天"); break;case 11: System.out.println("十一月份为30天"); break;case 12: System.out.println("十二月份为31天"); break; } }}
添加回答
举报
0/150
提交
取消