I have asked for help earlier, I found my mistake and tried again. This works fine on Eclipse but it doesn't count it as correct here. Do you see any mistakes?
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 = 0;
int N = Integer.parseInt(reader.readLine());
int [] list = new int[N];
for(int i = 0; i < N; i++) {
int a = Integer.parseInt(reader.readLine());
if (a > 0) {
list[i] = a;
} else {
System.out.println("Enter positive number");
i--;
}
}
int largest = list[0];
for(int j = 1; j < list.length; j++) {
if (list[j] > largest) {
largest = list[j];
}
maximum = largest;
}
System.out.println(maximum);
}
}