Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java plastic classification
Java plastic classification
public static void main(String[]args){? Scanner Scan = New Scanner (system input).

}

System.out.println ("output from big to small:");

for(int m = num . length- 1; m & gt=0; m - ) {

system . out . println(num[m]); //Output from large to small

}

}

String [] str = scan. nextline()。 Split ("",//Enter a number with spaces.

int[]num = new int[str . length]; //Initializes an integer array with the length of the number of digits you enter.

String[] str = scan.nextLine()。 Split (""); //Enter numbers separated by spaces.

int[]num = new int[str . length]; //Initializes an integer array with the length of the number of digits you enter.

for(int I = 0; I < string length; i++) {

num[I]= integer . parse int(string . value of(str[I])); //Convert characters into int types and assign them to integer arrays.

}

arrays . sort(num); //Sort in ascending order

System.out.println ("output from small to large:");

for(int j = 0; J< number length; j++) {

system . out . println(num[j]); //Output from small to large