Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package _10_ArraysExercises;
- import java.util.Arrays;
- import java.util.Scanner;
- public class _05_TopIntegers {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int[] input = Arrays.stream(scanner.nextLine().split(" "))
- .mapToInt(Integer::parseInt)
- .toArray();
- for (int i = 0; i < input.length; i++) {
- boolean isGrater = true;
- for (int j = i + 1; j < input.length; j++) {
- if (input[i] <= input[j]) {
- isGrater = false;
- break;
- }
- }
- if (isGrater) {
- System.out.print(input[i] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement