package com.codegym.task.task07.task0704;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
/*
Flip the array
*/
public class Solution {
public static void main(String[] args) throws Exception {
//array int 10 elements
Integer[] list = new Integer[10];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0 ; i < 10; i++)
try {
list[i] = Integer.parseInt(br.readLine());
}catch(NumberFormatException e){
System.out.print("Enter a integer number please!\n");
i--;
}
Arrays.sort(list, Collections.reverseOrder());
for (int i=0; i <10; i++ )
System.out.println(list[i]);
}
}
package com.codegym.task.task07.task0704;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
/*
Flip the array
*/
public class Solution {
public static void main(String[] args) throws Exception {
//array int 10 elements
Integer[] list = new Integer[10];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0 ; i < 10; i++)
try {
list[i] = Integer.parseInt(br.readLine());
}catch(NumberFormatException e){
System.out.print("Enter a integer number please!\n");
i--;
}
Arrays.sort(list, Collections.reverseOrder());
for (int i=0; i <10; i++ )
System.out.println(list[i]);
}
}