java - System.in.read conversion to integer not working -
I am trying to create an input class so that it reads faster than the BufferedReader
class Could. About me right now, but in some way this code does not work as a purpose. I am basically using the readInt ()
method of this class, which should read an integer at a time, but what does it do that it reads 1 integer properly, but then It omits the first letter of the second integer
INPUT: 1 234 Output: 34 Case 2: Input: 2 3 4 5 6 Output: 4 6 I think the next time the The readInt ()
method is said to be that it is still reading the new letter of the previous input, but I Only understand why this is happening. Can anyone help me?
Import java.io.IOException; Public Class Main {/ ** * @ PRAM RGR * @ Thraze IOException * / Public Static Zero Main (string [] args throws IOException {fast input font = new fast input (); Int T = fi.readInt (); Int [] arr = new int [100]; //System.out.println(- We are here, the value of T is: "+ T); for (int i = 0; i & lt; T; i ++) {arr [i] = fi.readInt {};} System.out.println ("Printing the array:"); for (int i = 0; i ; ''); if (negative) {return-enter;} and {return integer;}} The public string readString () throws exception {StringBuffer sb = new string buffer (""); B = readByte (); while (B & L; = '') B = redBit (); do {sb.append ((four) b ); B = readByte ();} while (B & gt; ''); return sb.toString ();}}
Comments
Post a Comment