题解 | #简单密码#
简单密码
http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
strlist = input()
strlist1 = []
dict = {'abc': 2, 'def': 3, 'ghi': 4, 'jkl': 5, 'mno': 6, 'pqrs': 7,
'tuv': 8, 'wxyz': 9, '0': 0, '1': 1}
for i in range(len(strlist)):
for key in dict:
if strlist[i] in key:
strlist1.append(str(dict[key]))
if(strlist[i].isupper()) & (strlist[i] != 'Z'):
temp = ord(strlist[i].lower()) + 1
strlist1.append(chr(temp))
elif strlist[i] == 'Z':
strlist1.append('a')
elif (strlist[i].isdigit()) & (strlist[i] != '1') & (strlist[i] != '0'):
strlist1.append(strlist[i])
print(''.join(strlist1))