是不是因为编码是unicode的原因呀?
我还没有调试成功。

解决方案 »

  1.   

    读入字符串,然后再转为int型。
      

  2.   

    用Integer.parseInt();
    a 赋的值是一个字符串,
    应该定义一个int,然后用Integer.parseInt()使字符串转为int型
    我也是刚学,不好意思!
    也不太懂。
      

  3.   

    import java.io.* ;
    public class ch3

     public static void main(String args[]) throws IOException
      {
       DataInputStream in=new DataInputStream(System.in);
       
       String year;
       
       boolean b;
       System.out.print("请输入年份:  ");
       year=in.readLine();
       int a = Integer.parseInt(year);
       System.out.println("a="+a);
       b=(a%4==0&&a%100!=0)||a%400==0;
      System.out.println("b="+b);
      if(b==true)
        {
        System.out.println(a+"年是闰年");
        }
      else
        {
         System.out.println(a+"年不是闰年");
         }
      in.close();
      }
    }这样可以通过,而且结果正确。