题解 | #字符串排序#
字符串排序
http://www.nowcoder.com/practice/5190a1db6f4f4ddb92fd9c365c944584
def func(x):
return ord(x.lower())
while True:
try:
a = input()
b = []
c = []
for i in range(len(a)):
if a[i].isalpha():
b.append(a[i])
else:
c.append((i,a[i]))
b = sorted(b,key=func)
for i,j in c:
b.insert(i,j)
print(''.join(b))
except:
break