It says, that there is not enought lines. I think, the problem is in 22 line(in help section it occures meny times). Can someone explain why it is working like this?
package pl.codegym.task.task13.task1326;
/*
Sortowanie liczb parzystych z pliku
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileInputStream file = new FileInputStream(reader.readLine());
BufferedReader fileReader = new BufferedReader(new InputStreamReader(file));
ArrayList<Integer> lista = new ArrayList<>();
int x;
while (file.available() > 0){
x = Integer.parseInt(fileReader.readLine());
if (x % 2 == 0) {
lista.add(x);
}
}
file.close();
fileReader.close();
Collections.sort(lista);
for (Integer y : lista){
System.out.println(y);
}
}
}