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