package com.codegym.task.task07.task0728; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; /* In decreasing order */ public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Integer[] array = new Integer[20]; for (int i = 0; i < 20; i++) { array[i] = Integer.parseInt(reader.readLine()); } // sort(array); Arrays.sort(array, Collections.reverseOrder()); for (int x : array) { System.out.println(x); } } public static void sort(Integer[] array) { //write your code here for (int x : array) { System.out.println(x); } } } Input == 1 2 3 4 5 6 7 9 8 12 11 14 43 54 666 7777 88888 999999 6767 565 Output == 999999 88888 7777 6767 666 565 54 43 14 12 11 9 8 7 6 5 4 3 2 1