ublic class Demo_3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入字符串");
while (true) {
String asd = sc.nextLine();
String str = asd;
if (str.equals("end")) {
System.out.println("嘿嘿 结束");
break;
} else {
char[] chars = str.toCharArray();
for (int i = chars.length; i == 0; i--) {
Arrays.sort(chars);
System.out.println(chars[i]);
}
}
}
}
}
|
|