day=Integer.parseInt(new BufferedReader(new InputStreamReader(System.in)).readLine());
我用上面的代码可以输入数字,而且结果正确
input=new DataInputStream(System.in).readInt();
但是我用这行代码却不行,这是打出来得input:1
2
822938162
3
218772237
1
170986762
2
35
839715379
4
890047028
6
218773005
8
171445514
6
4
906824244
请问这是为什么?
我用上面的代码可以输入数字,而且结果正确
input=new DataInputStream(System.in).readInt();
但是我用这行代码却不行,这是打出来得input:1
2
822938162
3
218772237
1
170986762
2
35
839715379
4
890047028
6
218773005
8
171445514
6
4
906824244
请问这是为什么?
而dataInputStream读取四个字节如a,b,c,d
返回值为:
(((a & 0xff) << 24) | ((b & 0xff) << 16) |
((c & 0xff) << 8) | (d & 0xff))可以参见api