Please see solution - it have checked this with all numbers including the supplied ones for the test and it work but is still failing?
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 n = Integer.parseInt(reader.readLine());
int maximum = 0;
for (int i = 0; i < n; i++) {
int tempNum = Integer.parseInt(reader.readLine());
if (i == 0) maximum = tempNum;
if (tempNum > maximum) maximum = tempNum;
}
if (maximum > 0) System.out.println(maximum);
}
}