So I am trying to solve this task and it says on condition 5 to make sure it works correctly for negative numbers, but under my logic it should not give any issues. What's wrong then??
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 numb2 = 0;
String sNumb1 = reader.readLine();
int numb1 = Integer.parseInt(sNumb1);
if(numb1 > 0){
for(int i = 0; i < numb1; i++){
String sNumb2 = reader.readLine();
if(Integer.parseInt(sNumb2) > maximum){
maximum = Integer.parseInt(sNumb2);
}
}
System.out.println(maximum);
}
}
}