I have the test for negative numbers, and it looks fine. But when submitting it says 'Ensure that the program can handle negative numbers correctly.'
package zh.codegym.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 = 0;
if (N <= 0) {
System.out.println();
} else if (N == 1) {
max = Integer.parseInt(reader.readLine());
System.out.println(max);
} else if (N > 1) {
int[] arr = new int[N];
max = Integer.parseInt(reader.readLine());
max = arr[0];
for (int i = 1; i < N; i++) {
int NN = Integer.parseInt(reader.readLine());
arr[i] = NN;
if (arr[i] > max) {
max = arr[i];
}
}
System.out.println(max);
}
}
}