/* int i = 100;
String s = String.valueOf(i);
System.out.println(s);
String s1 = "350";
Integer i1 = Integer.valueOf(s1);
int i2 = i1.intValue();
System.out.println(i2);
Integer i3 = Integer.parseInt(s1);
System.out.println(i3);*/
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);
|
|