题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
a = list(input())
s = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ss =[2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9]
for i in a:
if 'A' <= i <= 'Y':
index = s.index(i.lower())
print(s[index+1],end = '')
elif i == 'Z':
print('a',end = '')
elif 'a' <= i <= 'z':
index = s.index(i)
print(ss[index],end = '')
else:
print(i,end = '')
查看21道真题和解析