Guest User

Sort Numbers

a guest
Oct 13th, 2021
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class demo {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String input = scanner.nextLine();
  9.  
  10. String[] numbers = input.split(", ");
  11.  
  12. for (int i = numbers.length - 1; i >= 0 ; i--) {
  13. System.out.print(numbers[i] + ", ");
  14. }
  15. }
  16. }
  17.  
RAW Paste Data