Online did not pass the test. Sorry but is a basic standard bouble sort descendent. I try ascending and descending and ok.. I didn't understand why..
package com.codegym.task.task08.task0826;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
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[20];
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) {
int n = array.length;
int temp = 0;
for (int i = 0; i <n; i++) {
for (int j = 1; j <(n-1); j++) {
if(array[j-1]<array[j]){
temp=array[j-1];
array[j-1]=array[j];
array[j]=temp;
}
}
}
}
}