BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = MIN_VALUE;
int n = Integer.parseInt(reader.readLine());
if (n>0) {
for (int i = 0; i < n; i++) {
int num = Integer.parseInt(reader.readLine());
if (num > maximum) {
maximum = num;
}
}
}
if (maximum>0)
System.out.println(maximum);
else;

package com.codegym.task.task05.task0532;
import java.io.*;
import static java.lang.Integer.MIN_VALUE;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = MIN_VALUE;
int n = Integer.parseInt(reader.readLine());
if (n>0) {
for (int i = 0; i < n; i++) {
int num = Integer.parseInt(reader.readLine());
if (num > maximum) {
maximum = num;
}
}
}
if (maximum>0)
System.out.println(maximum);
else;
}
}

Integer.MIN_VALUE; - but yours might be a shorthand that the compiler understands) 2. Line 30: Your program only prints something if the maximum is greater than zero. What if all the entered numbers (apart from the length N, which must be positive) are negative? Then your maximum of, say, -3 -7 and -11 is "-3" and therefore wouldn't be printed at all.