DataInputStream in = new DataInputStream(System.in);
in.readInt();

解决方案 »

  1.   

    byte b1[] = new byte[255];
    in.read(b1);
    String s = new String(b1);
    int value = Integer.parseInt(s);
      

  2.   

    好像是有问题,我编译可以通过,可是运行就出现以下这样的错误:
    Exception in thread "main" java.lang.NumberFormatException:5(我输入5)
        at java.lang.Integer.parseInt<Integer.java:438>
        at java.lang.Integer.parseInt<Integer.java:479>
        at Red.main<read.java:12>
      

  3.   

    import java.util.*;
    import java.io.*;public class Test5{
      public static void main(String[] args){
        int i = 0;
        char c;
        int ii=0;
        try{
          i = System.in.read();
          c=(char) i;
          ii = Character.getNumericValue(c); 
          //ii =Integer.parseInt(String.valueOf(c)); 
     
          System.out.println("Your input is:"+c+" ascii is "+i);
        }
        catch(IOException e){}    System.out.println("Length will be:"+ii);
      }

     
     
      

  4.   

    InputStreamReader inputstreamreader = new InputStreamReader(System.in);
            BufferedReader in = new BufferedReader(inputstreamreader);
            int i =Integer.parseInt(in.readLine());
      

  5.   

    xmvigour(微电) 的方法是对的!