public class Getminnumber {
public static void Main (string[] args) {
string[] arr = null;
System.out.println ("Enter a row of integer data to be processed, separated by commas:");
Scanner input = new Scanner (system.in);
arr = Input.nextline (). Split (",");
Sort (arr);
for (String S:arr) {
System.out.print (s+ "");
}
}
public static void sort (string[] arr) {
for (int i = 0; i < arr.length-1; ++i) {
for (int j = 0; j < arr.length-1; ++j) {
int p = 0, q = 0;
String temp = "";
char[] C1 = Arr[j].tochararray ();
char[] C2 = arr[j + 1].tochararray ();
while (P < c1.length && Q < c2.length) {
if (C1[p] > C2[q]) {
temp = Arr[j];
ARR[J] = arr[j+1];
ARR[J+1] = temp;
Break
}
if (p = = C1.length-1 && q! = c2.length-1 && c1[p] > c2[q+1]) {
temp = Arr[j];
ARR[J] = arr[j+1];
ARR[J+1] = temp;
Break
}
if (q = = C2.length-1 && p! = c1.length-1 && c1[p+1] > C2[q]) {
temp = Arr[j];
ARR[J] = arr[j+1];
ARR[J+1] = temp;
Break
}
++p;
++q;
}
}
}
}
}
An integer array containing n elements that will be re-assembled to find the smallest number, such as {321,3,32}, with a minimum number of 321323