Cześć, potrzebuje pobrać dwa inty z jednej linii, a linii będzie kilka jedna po drugiej. Coś tam kombinowałem ale nic nie działa tak jak bym chciał, przeszukałem StackOverFlow itp..
na dzień dobry dostaje "Exception in thread "main" java.lang.NumberFormatException: For input string: "" i nie wiem gdzie tkwi problem.
proszę o wskazówkę co może być nie tak Pozdrawiam
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int howTimes = sc.nextInt();
String[] lines = new String[howTimes];
List<Integer> listOfParsedInts = new LinkedList<Integer>();
for (int i = 0; i < howTimes; i++) {
lines = sc.nextLine().split(" ");
for (int j = 0; j < lines.length; j++) {
listOfParsedInts.add(Integer.parseInt(lines[j]));
}
}
sc.close();
}
}