2nd last condition is not getting.
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;
int temp;
int p = 1;
int x = Integer.parseInt(reader.readLine());
int[] a = new int[10];
for(int i=0; i < x; i++){
a[i] = Integer.parseInt(reader.readLine());
}
maximum = a[0];
while(p < x-1){
if(a[p] > maximum){
maximum = a[p];
p++; }
else{
p++;}
}
if(maximum <= 0){ }
else{
System.out.println(maximum);}
}
}