不多说,看代码,你懂得
#include <iostream>
using namespace std;
int main()
{
char str[]={"I am Tomato"};
int size=sizeof(str);
cout<<"the original string:"<<endl;
cout<<str;
for(int i=0;i<size;i++)
{
if(str[i]==' ')
cout<<str[i];
else{
str[i]=str[i]+1;
cout<<str[i];
}
}
}