It said "Be sure that the sort() method is able to sort arrays of different lengths."
package com.codegym.task.task08.task0826;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Five winners
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[25];
for (int i = 0; i < array.length; i++) {
array[i] = Integer.parseInt(reader.readLine());
}
sort(array);
System.out.println(array[0]);
System.out.println(array[1]);
System.out.println(array[2]);
System.out.println(array[3]);
System.out.println(array[4]);
}
public static void sort(int[] array) {
//write your code here
int temp = 0;
for (int i = array.length-1; i > 0; i--) {
for (int j = 1; j < i; j++) {
if (array[j-1] < array[j]) {
temp = array[j-1];
array[j-1] = array[j];
array[j] = temp;
}
}
}
}
}