代码如下```cpp
#include
#include
#include
using namespace std;
int main(){
char str1[101];//存输入数据
char str2[101];//输出数据
scanf("%[^\n]",str1);
//printf("%s",str1);
int length = strlen(str1);
for(int i = 0;i < length-1;i++){
//printf("%d",str1[i]);
str2[i] = (int)str1[i] + (int)str1[i+1];
}
str2[length-1] = str1[length-1] + str1[0];
printf("%s",str2);
return 0;
}
[未开O2优化](https://www.luogu.com.cn/record/102242342)
[开了O2优化](https://www.luogu.com.cn/record/102242336)