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