it works well for negative numbers... but the it did not pass the test.
and how to not display anything when n<=0
plis help
package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
import java.io.*;
public class Solution{
public static void main(String[] args)throws Exception{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
int i = Integer.parseInt(s);
int n = 1;
int max = 0;
while(n<=i){
String s1 = reader.readLine();
int i1 = Integer.parseInt(s1);
if(i1>max){
max = i1;
}
n++;
}
System.out.println(max);
}
}