题解 | #字符串合并处理#
字符串合并处理
http://www.nowcoder.com/practice/d3d8e23870584782b3dd48f26cb39c8f
def func(i):
if i in '0123456789abcdefABCDEF':
f = bin(int(i,16))[2:].zfill(4)[::-1]
i=hex(int(f,2))[2:].upper()
return i
while 1:
try:
str2 = list(input().replace(' ',''))
str2[::2] = sorted(str2[::2])
str2[1::2] = sorted(str2[1::2])
str3 = ''
for i in str2:
str3+=func(i)
print(str3)
except:
break

上海得物信息集团有限公司公司福利 1233人发布