Can't seem to solve why not passing the Max of N - seems to work with all the test data
Any pointers would be appreciated
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;
int count = 1;
//write your code here
int input = 0;
int number = Integer.parseInt(reader.readLine());
if (number > 0)
{
while(count <= number )
{
input = Integer.parseInt(reader.readLine());
if(input >= maximum)
maximum = input;
count++;
}
System.out.println(maximum);
}
}
}