题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5190a1db6f4f4ddb92fd9c365c944584
s = input() ss = '' res = '' index = 0 for i in s: if i.isalpha(): ss += i ss = sorted(ss,key=str.upper) for k in range(len(s)): if s[k].isalpha(): res += ss[index] index += 1 else: res += s[k] print(res)