AcWing 3407. 密码翻译
原题链接
简单
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e6 + 10;
int t, n, m, k, l, r, op, x, y;
int f[N];
string str;
void solve() {
while (getline(cin, str)) {
for (char &ch : str) {
if (ch >= 'A' && ch <= 'Z') {
ch = (ch - 'A' + 1) % 26 + 'A';
} else if (ch >= 'a' && ch <= 'z') {
ch = (ch - 'a' + 1) % 26 + 'a';
}
}
cout << str << "\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}