I can't understanding why I'm not outputting anything.
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 max = 0;
int n = Integer.parseInt(reader.readLine());
if (n >= 0){
while (true){
int input = Integer.parseInt(reader.readLine());
if (input > max){
input = max;
}
if (input <= 0){
break;
}
}
}
if (max>0){
System.out.println(max);}
}
}