For some reason I'm unable to find the error. I would appreciate any help with this problem.
Thanks in advance.
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 = Integer.MIN_VALUE, counter, number;
counter = Integer.parseInt(reader.readLine());
if (counter > 0) {
for(int i = 0; i < counter; i++){
number = Integer.parseInt(reader.readLine());
if(number > maximum){
maximum = number;
}
}
if(maximum > 0){
System.out.println(maximum);
}
}
}
}