Any help will be appreciated.
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 , num;
//reads a number n
int n = Integer.parseInt(reader.readLine());
//checks if n > 0
if (n > 0){
//reads n numbers from the keyboard
for (int i=0; i < n; i++){
num = Integer.parseInt(reader.readLine());
//evaluates the maximum
maximum = maximum > num ? maximum : num;
}
//displays the maximum
System.out.println(maximum);
}
}
}