오름차순
Scanner scan = new Scanner(System.in);
String[] arr = scan.nextLine().split(" ");
int [] inArr = new int[arr.length];

for(int i=0; i<arr.length; i++){
	inArr[i] = Integer.valueOf(arr[i]);
}
Arrays.sort(inArr);

 

내림차순
Scanner scan = new Scanner(System.in);
String[] arr = scan.nextLine().split(" ");
int [] inArr = new int[arr.length];

for(int i=0; i<arr.length; i++){
	inArr[i] = Integer.valueOf(arr[i]);
}

Arrays.sort(inArr,Collections.reverseOrder());
 
복사했습니다!