由于字母表大小为 26,平移量可先取模:k %= 26,避免大数重复计算。
对于每个字符 c:
idx = c - 'a'(0~25)。nxt = (idx + k) % 26。ch = 'a' + nxt。ch。小红发明了一种 k 法则加密。

Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册