не выполняется 3е условие.значит ошибка в цикле с четными числами.но я ее в упор не вижу
package com.javarush.task.pro.task05.task0505;
import java.util.Scanner;
/*
Reverse
*/
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
if(a > 0){
int [] array = new int[a];
if(a % 2 == 0){
for(int i = a - 1 ; i >= 0; i--){
array[i] = sc.nextInt();
System.out.println(array[i] + " ");
}
}
else{
for(int i = 0; i < a ; i++){
array[i] = sc.nextInt();
System.out.println(array[i] + " ");
}
}
}
}
}