对输入的字符串中的字符进行排序并输出。
输入格式:
在一行内输入一个字符串。
输出格式:
对该字符串内的字符进行排序后(按ASCII码进行升序排序)输出。
输入样例:
在这里给出一组输入。例如:
h!dy%2dh1
输出样例:
在这里给出相应的输出。例如:
!%12ddhhy
import java.util.Arrays;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
char[] ch = str.toCharArray();
Arrays.sort(ch);
String sortedStr = new String(ch);
System.out.print(sortedStr);
in.close();
System.exit(0);
}
}