Negative numbers - what should happen? I make a break from the loop, but should it ignore ? Maybe something else is wrong?
import java.util.Scanner;

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int maximum = -2147483648;
        int inputNumber = sc.nextInt();

        while (inputNumber > 0) {
            int inputMaximum = sc.nextInt();
            maximum = Math.max(maximum, inputMaximum);
            inputNumber--;
        }

        if (maximum <= 0) {
        }

        else {
            System.out.println(maximum);
        }
    }
}