//****************************
//写出一个程序,接受一个字符串,
//然后输出该字符串反转后的字符串。
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
string str;
while(getline(cin,str))
{
for(int i=str.length()-1;i>=0;i--)
cout<<str[i];
}
return 0;
}
【c++程序】字符串反转
最新推荐文章于 2025-06-29 20:50:39 发布