先挑出来干净的,排序,然后再见机插回去

while True:
    try:
        s = input()
        a = ''
        for i in s:
            if i.isalpha():
                a += i
        b = sorted(a, key=str.upper) #注意这个排序方法,upper后无()
        index = 0
        d = ''
        for i in s:
            if i.isalpha():
                d = d + b[index]
                index += 1
            else:
                d = d + i
        print(d)
    except:
        break