Почему не проходит ?
package com.javarush.task.task07.task0701;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Массивный максимум
*/
public class Solution {
public static void main(String[] args) throws Exception {
int[] array = initializeArray();
int max = max(array);
System.out.println(max);
}
public static int[] initializeArray() throws IOException {
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
//System.out.println("Введите размер массива: ");
int a = 20; //Integer.parseInt(read.readLine());
int[] as = new int[a];
int count = 0;
while (count <= a - 1) {
as[count] = 1;
count++;
}
count = 0;
while (count <= a - 1){
int b = Integer.parseInt(read.readLine());
as[count] = b;
count++;
}
return as;
}
public static int max(int[] array) {
int count = array.length-1; // 5
int max = array[0];
int i = 1;
while(i <= count){
max = Math.max(max,array[i]);
i++;
}
return max;
}
}