Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124078 柯轶炜 破译邮件 Python3 Accepted 35 MS 3784 KB 622 2025-07-10 22:34:32

Tests(1/1):


Code:

def decode_email(s): result = [] i = 0 while i < len(s): if s[i] == '#': result.append(' ') i += 1 elif s[i] == '-': i += 1 else: # 检查两位数情况 if i+1 < len(s) and s[i+1].isdigit() and int(s[i:i+2]) <= 26: result.append(chr(64 + int(s[i:i+2]))) i += 2 else: result.append(chr(64 + int(s[i]))) i += 1 return ''.join(result) C = int(input()) for _ in range(C): s = input().strip() print(decode_email(s))