题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
strx = "" litter = "abcdefghijklmnopqrstuvwxyza" litterMap = {"2":["a","b","c"], "3":["d","e","f"], "4":["g","h","i"], "5":["j","k","l"], "6":["m","n","o"], "7":["p","q","r","s"], "8":["t","u","v"], "9":["w","x","y","z"]} for s in input(): if s.isupper(): strx += litter[litter.find(s.lower()) + 1] elif s.islower(): for i in litterMap: if s in litterMap[i]: strx += i break else: strx += s print(strx)