C++ 字符串循环输出:'Hello World' 的每个字符的下一个字符
#include
int main() { string str = 'hello world';
for (int i = 0; i < str.length(); i++) {
char nextChar = str[i] + 1;
cout << nextChar;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/bdMf 著作权归作者所有。请勿转载和采集!