package com.codegym.task.task08.task0826; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.* ; /* 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 swap ; for (int c = 0; c < ( 20 - 1 ); c++) { for (int d = 0; d < 20 - c - 1; d++) { if (array[d] < array[d+1]) { swap = array[d]; array[d] = array[d+1]; array[d+1] = swap; } } } } }