Мне пишет чтобы я убедился, что программа работает корректно для отрицательных чисел
package com.javarush.task.task05.task0532;
/*
Задача по алгоритмам
*/
import java.io.*;
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 max = 1;
if (N > 0){
for (int i = 0; i < N; i++){
int a = Integer.parseInt(reader.readLine());
if (a >= max){
max = a;
}
else{
}
}
System.out.println(max);
}
}
}