思维导图
#include <iostream>using namespace std;
namespace st_open
{string a1;string retval(string a1);}
using namespace st_open;
int main()
{getline(cin,a1);cout << "逆置前的字符串:" << a1 << endl;a1=rerval(a1);cout << "逆置后的字符串:" << a1 << endl;return 0;
}
//字符串逆置
string st_open::retval1(string a1)
{string a2=a1;for(int i=0;i<(int)a1.size();i++){a1[a1.size()-1-i]=a2[i];}return a1;
}