将一整个正整数的所有位重新排序,组成一个最大数
取出所有位置的数字,按照从大到小排序,
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int num= Integer.parseInt(s);
// int num=sc.nextInt();
// int n[]=new int[(num+"").length()];
int n[]=new int[s.length()];
for(int i=0;i<n.length;i++)
{
n[i]=num%10;
num=num/10;
}
Arrays.sort(n);
for(int i=n.length-1;i>=0;i--) {
System.out.print(n[i]);
}
}