Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Arrays;
- import java.util.Collections;
- class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String[] arr = Arrays
- .stream(scanner.nextLine().split(" "))
- .toArray(String[]::new);
- Collections.reverse(Arrays.asList(arr));
- System.out.println(String.join(" ", arr));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement