Few day ago i found out that i still didn't finish this task. So i try to do it and i don't know why but this task doesn't work. I don't get any detalied information about verification of my program right here and also on IntelliJ... I don't know what is going on. A few minutes ago i finish another tasks and it's working fine i have information why my solution didn't pass the verification.
package pl.codegym.task.task05.task0532;
import java.io.*;
import java.util.ArrayList;
/*
Zadanie z algorytmami
*/
public class Solution {
public static void main(String[] args) throws Exception, IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> lista = new ArrayList<>();
int ilosc = Integer.parseInt(reader.readLine());
int liczba;
if(ilosc>0) {
for (int a = 0; a < ilosc; a++) {
liczba = Integer.parseInt(reader.readLine());
lista.add(liczba);
}
}else{
System.exit(0);
}
int maksimum = lista.get(0);
for (int b = 0; b < lista.size(); b++) {
if (lista.get(b) > maksimum) {
maksimum = lista.get(b);
}
}
//tutaj wpisz swój kod
System.out.println(maksimum);
reader.close();
}
}