请各位大佬帮忙看看第二题是IO有什么问题吗?为什么本地能通过,测试样例也能通过,提交就是0%呢?(PS:上次室友做网易的笔试也遇到这样的问题,感觉不解决这个问题以后都只能是0%了),谢谢大家。
while True:
try:
T = eval(input())
for i in range(T):
ini_num = input()
n = len(ini_num)
num = (3 - n % 3) * '0' + ini_num
sep1 = []
i = 0
j = 3
while i < len(num):
sep1.append(num[i:j])
i = j
j = i + 3
sep2 = ''
for i in range(len(sep1)):
temp = bin(int(sep1[i]))[2:]
if i == 0:
pass
else:
if len(temp) < 10:
temp = '0' * (10 - len(temp)) + temp
sep2 += temp
sep2 = (5 - len(sep2) % 5) * '0' + sep2
i = 0
j = 5
sep3 = []
while i < len(sep2):
sep3.append(sep2[i:j])
i = j
j = i + 5
ans = ''
for item in sep3:
digit = int(item, 2)
if digit >= 10:
ans += chr(ord('A') + digit - 10)
else:
ans += str(digit)
print(ans)
except:
break