题解 | #简单密码#
简单密码
http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
while True:
try:
s=input()
l=[]
dic={"abc":'2',"def":'3',"ghi":'4',"jkl":'5',"mno":'6',"pqrs":'7',"tuv":'8',"wxyz":'9'}
for i in s:
if i.isdigit():
l.append(i)
elif i.isupper():
if i == 'Z':
l.append('a')
else:
l.append(chr(ord(i.lower())+1))
else:
for key in dic.keys():
if i in key:
l.append(dic.get(key))
print("".join(l))
except Exception as e:
# print(e)
break