#输入字符串 n=input() #对字符串中各个字符进行遍历 for i in range(len(n)): #若该字符是数字,则直接输出 if n[i].isdigit(): print(int(n[i]),end='') #若该字符是小写字母,则按照拼音9键的规则,输出对应的数字 elif n[i].lower()==n[i]: if n[i] in ('a','b','c'): print(2,end='') elif n[i] in ('d','e','f'): print(3,end='') elif n[i] in ('g','h','i'): print(4,end='') elif n[i] in ('j','k','l'): print(5,end='') elif n[i] in ('m','n','o'): print(6,end='') elif n[i] in ('p','q','r','s'): print(7,end='') elif n[i] in ('t','u','v'): print(8,end='') elif n[i] in ('w','x','y','z'): print(9,end='') #若该字符是大写字母,则将字符转ASCII码,并变回去,再进行输出 #Ps:注意'Z'无法通过以上方法变成'a' elif n[i].upper()==n[i]: if n[i]=='Z': print('a',end='') elif n[i]!=' ' and n[i]!='Z': x=ord(n[i].lower()) x=x + 1 x=chr(x) print(x,end='')