If your input is 013601267< enter>, in.nextInt()
will take 013601267 as a single int because there are no space between digits. So you should call in.nextInt()
one time and parse it into digits as you wanted.
Consider your input number begins with 0, you'd better use in.nextLine()
to get it as a String instead of int, or the 0 at first position will be ignored.
You can do it like this:
while(in.hasNextLine) {
String line = in.nextLine();
int c1 = Integer.valueOf(line.substring(0,1));
int c2 = Integer.valueOf(line.substring(1,2));
//more lines here
}