P1914 小书童——凯撒密码

题目传送门

#include <bits/stdc++.h>

using namespace std;

int n;
string s;

int main() {
    cin >> n >> s;
    for (int i = 0; i < s.size(); i++) {
        int c = s[i] + n;
        if (c > 'z') c = c - 'z' - 1 + 'a';
        s[i] = c;
    }
    cout << s << endl;
    return 0;
}
posted @ 2021-11-18 09:34  糖豆爸爸  阅读(104)  评论(0编辑  收藏  举报
Live2D