Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Excirsice;
- import java.util.Scanner;
- public class TopIntegers_05 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String[] input = scan.nextLine().split("\\s+");
- int[] numbers = new int[input.length];
- for (int i = 0; i < input.length; i++) {
- numbers[i] = Integer.parseInt(input[i]);
- }
- for (int i = 0; i < numbers.length - 1; i++) {
- if (numbers[i] > numbers[i + 1]) {
- System.out.print(numbers[i]+" ");
- }
- }
- System.out.print(numbers[numbers.length - 1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement