Can anybody tell me what is wrong with my solution. I prevent to use numbers lower or equal 0 so the condition is fulfilled. So why i cant finish the task??
package pl.codegym.task.task05.task0532;
import java.io.*;
/*
Zadanie z algorytmami
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
int maksimum = 0;
if (n != 0 && !(n < 0)){
while (n > 0){
int i = Integer.parseInt(reader.readLine());
n--;
maksimum = Math.max(maksimum,i);
}
}
System.out.println(maksimum);
}
}