题解 | #字符串排序#
字符串排序
http://www.nowcoder.com/practice/5190a1db6f4f4ddb92fd9c365c944584
while True:
try:
# 截取并排序
s = input()
a = ""
for x in s:
if x.isalpha():
a += x
sort_a = sorted(a, key=lambda x: x.upper())
b = ""
pos = 0
for x in s:
if x.isalpha():
b += sort_a[pos]
pos += 1
else:
b += x
print(b)
except:
break