竟然可以直接排序,枉我思考那么久。
import sys str_1 = input() list_1=list(str_1) list_1.sort() str_1=''.join(list_1) print(str_1)