I get the following issue:
com/codegym/task/task05/task0532/Solution.java:29: error: reached end of file while parsing
}
^
but cannot work out why it has reached end of file even though my "for" loop condition should stop reading the file after the fifth read (using the supplied numbers).
Any ideas?
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 = Integer.MIN_VALUE;
int count = Integer.parseInt(reader.readline());
if (count > 0)
{
for(int i=0; i<count; i++)
{
int number = Integer.parseInt(reader.readline());
max = number>max?number:max;
}
System.out.println(max);
}
}