Run ID:117313

提交时间:2025-04-16 20:40:37

#include <bits/stdc++.h> using namespace std; string s; int main() { //cin >> s; //gets(s); //gets 是用在 char 数组 getline(cin, s); //cout << s << endl; for(int i = 0; i < s.size(); ++i) { if(s[i] >= 'A' && s[i] <= 'Z' || s[i] >= 'a' && s[i] <= 'z') { //cout << s[i] << endl; //cout << (char)(s[i] - 25) << endl; //s[i] 是大写字母或者小写字母的一种 if(s[i] != 'Z' && s[i] != 'z') s[i] += 1; else s[i] -= 25; } } cout << s << endl; return 0; }