题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
pw = input()
l = ['1--1', 'abc--2', 'def--3', 'ghi--4', 'jkl--5', 'mno--6', 'pqrs--7', 'tuv--8','wxyz--9', '0--0']
n = 'abcdefghijklmnopqrstuvwxyza'
s = ''
for i in pw:
if i.isupper():
index = int(n.find(i.lower())) + 1
s += n[index]
for x in l:
if i in x:
s += x[-1]
print(s)
l = ['1--1', 'abc--2', 'def--3', 'ghi--4', 'jkl--5', 'mno--6', 'pqrs--7', 'tuv--8','wxyz--9', '0--0']
n = 'abcdefghijklmnopqrstuvwxyza'
s = ''
for i in pw:
if i.isupper():
index = int(n.find(i.lower())) + 1
s += n[index]
for x in l:
if i in x:
s += x[-1]
print(s)