hi, i can't find what do not let me pass this exercise. It work well, but i can't get green on the display maximum number.
package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = 0;
int nLectures=Integer.parseInt(reader.readLine());
int check=1;
if (nLectures <0 || nLectures==0) {
check=0;
}
while (nLectures>0) {
int last = Integer.parseInt(reader.readLine());
if (last > maximum && last>0) {
maximum = last;
}
else if (last==0 || last <0) {
check=0;
}
nLectures--;
}
//write your code here
if (check==1){
System.out.println(maximum);
}
else {
}
}
}