快捷导航

大神帮找下错误?

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;   } }}

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

nextInt()
nextBoolean()
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP