String s = "51 83 99 12 34";
String[] strxxx = s.split(" ");
int[] arr = new int[strxxx.length];
for (int i = 0; i < arr.length; i++) {
arr[i] = Integer.parseInt(strxxx[i]);
System.out.println(arr[i]);
}
Arrays.sort(arr);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arr.length; i++) {
if (i == arr.length-1){
sb.append(arr[i]);
}else {
sb.append(arr[i]).append(" ");
}
}
String st = sb.toString();
System.out.println(st);