Can someone help figure out what's wrong?
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 n = Integer.parseInt(reader.readLine());
int max = Integer.parseInt(reader.readLine());
while(reader.readLine() != null){
if(n>=max)
max = n;
n = Integer.parseInt(reader.readLine());
}
if(max>0)
System.out.println(max);
}
}