Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigDecimal;
- import java.util.Arrays;
- import java.util.Scanner;
- public class _2_ThreeLargestNumbers {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner(System.in);
- int count = scan.nextInt();
- scan.nextLine();
- BigDecimal[] numbers = new BigDecimal[count];
- for (int i = 0; i < count; i++) {
- String nextLine = scan.nextLine();
- numbers[i] = new BigDecimal(nextLine);
- }
- Arrays.sort(numbers);
- for (int i = numbers.length - 1; i > numbers.length - 4 && i >= 0; i--) {
- System.out.println(numbers[i].toPlainString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement