It compiles, and displays the maximum of N entered numbers, but it won't pass the fifth requirement.
Thanks.
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 count = Integer.parseInt(reader.readLine());
if (count <= 0){
return;
}
for(int i = 0; i < count; i++){
int comp = Integer.parseInt(reader.readLine());
if (comp > maximum){
maximum = comp;
}
}
System.out.println(maximum);
}
}