Run ID:117009

提交时间:2025-04-13 13:10:16

#include <iostream> using namespace std; char nextChar(char c) { if (c == 'z') { return 'a'; } else if (c == 'y' || c == 'z') { // 如果需要处理'y'到'z'之外的字符,确保它们正常向后移动 return c + 1; } else { // 对于其他小写字母,直接加1 return c + 1; } } int main() { char chars[4]; cout << "Enter 4 lowercase letters: "; for (int i = 0; i < 4; ++i) { cin >> chars[i]; } for (int i = 0; i < 4; ++i) { cout << nextChar(chars[i]) << " "; } cout << endl; return 0; }