题解 | 字符串合并处理
字符串合并处理
https://www.nowcoder.com/practice/d3d8e23870584782b3dd48f26cb39c8f
a = input().split() a = list(a[0] + a[1]) a[::2] = sorted(a[::2]) a[1::2] = sorted(a[1::2]) for i in a: if i.isdigit() or (i.isalpha() and i.upper()<'G'): print(hex(int( ''.join(reversed(bin(int(i.lower(),16) )[2:].rjust(4,"0"))) ,2))[2:].upper(),end='') else: print(i,end='')