for i inrange(len(l)): s[i]=chr(((ord(l[i])-97)*a+b)%26+97) print("结果为:"+"".join(s))
defDecrypt(): c=input("请输入密文:")
k=c.lower() l=list(k) s=l
for i inrange(len(l)): s[i]=chr((dic[a]*(ord(l[i])-97)-(dic[a]*b)%26)%26+97) #s[i]=chr((dic[a]*((ord(l[i]))-dic[a]*b)%26)%26+97) print("结果为:"+"".join(s))