注意需要读取一行即可,因为字符串中有空格!

#include<iostream>
#include<cstring>

using namespace std;

int main()
{
    string s, ans;
    while(getline(cin, s))
    {
        for(int i = 0; i < s.size(); i++)
        {
            char c = s[i];
            if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
            {
                if(c == 'z') ans += 'a';
                else if(c == 'z') ans += 'Z';
                else{
                    ans += (c + 1);
                }
            }
            else ans += c;
            
        }
        cout << ans << endl;
    }
    return 0;
}