1.
#include <iostream>
#include <iomanip>
using namespace std;
namespace my_namespace {
void fun();
}
using namespace my_namespace;
void fun(string str1)
{
int j=str1.length()-1;
int i=0;
while(i<j)
{
char temp=str1.at(i);
str1.at(i)=str1.at(j);
str1.at(j)=temp;
i++;
j--;
}
cout << str1 <<endl;
}
int main()
{
string str1;
getline(cin,str1);
fun(str1);
return 0;
}
2.思维导图