I created the algorithm to find the maximum number from x input.It works but it doesn't fill the requirements. Somebody help please
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;
System.out.print("Please enter number of input : ");
int inputOfNum = Integer.parseInt(reader.readLine());
for (int i = 1; i <= inputOfNum; i++) {
System.out.println("Please enter the "+i);
int input = Integer.parseInt(reader.readLine());
if (input <= 0) {
break;
} else {
while (maximum<input) {
maximum = input;
}
System.out.println(maximum);
}
}
}
}