"The program should display the maximum of the N entered numbers."
RECOMMENDATION FROM YOUR MENTOR :
Be sure that the program works correctly for negative numbers.
I think that this is executed well for negative numbers........
MENTOR... What's wrong with me....
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 user = Integer.parseInt(reader.readLine());
int maximum = 0;
if (user <= 0);
else {
for (int i=0; i<user; i++) {
int num = Integer.parseInt(reader.readLine());
if (maximum < num)
maximum = num;
}
System.out.println(maximum);
}
}
}