I did every thing right and it gives the right answers but it's not being accepted?
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;
while (true) {
int i = Integer.parseInt(reader.readLine());
if (i > maximum){
maximum = i;
}
//write your code here
if (i > 0) {
System.out.println(maximum);
}
}
}
}