帮忙看一下
字符串长度改过输出还是light
#include
#include
using namespace std;
int main()
{
string str = “light”;
for (int i = 0; i++; i < 3)
{
char temp;
temp = str[i];
str[i] = str[5 - i];
str[5 - i] = temp;
}
cout << str << endl;
return 0;
}
为什么我这个不能实现c++的逆序输出字符串
最新推荐文章于 2024-09-11 11:31:11 发布