题解 | #字符串合并处理#
字符串合并处理
https://www.nowcoder.com/practice/d3d8e23870584782b3dd48f26cb39c8f
while True: try: s = list(input().replace(" ", "")) s[::2] = sorted(s[::2]) s[1::2] = sorted(s[1::2]) for i in s: if "0" <= i <= "9" or "a" <= i <= "f" or "A" <= i <= "F": n = hex(int(bin(int(i, 16))[2:].rjust(4, "0")[::-1], 2))[2:].upper() else: n = i print(n, end="") except: break