I have done numerous tests and all works.
For the 5th task the system give me error. Can u help me please to understand?
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 first = Integer.parseInt(reader.readLine());
maximum = first;
String current = reader.readLine();
if (first <= 0) {
return;
}
while( (current != null) && !current.equals("") ) {
int currentInt = Integer.parseInt(current);
if (currentInt > maximum) {
maximum = currentInt;
}
current = reader.readLine();
}
System.out.println(maximum);
}
}