#include<iostream>
using namespace std;
#define MaxLength 100
void conver(char* str)
{
int i=0;
int length;
length = strlen(str) ;
char temp;
for (i=0;i<length/2;i++)
{
temp = str[i] ;
str[i] = str[length-1-i] ;
str[length-1-i] = temp ;
}
}
void GetMemory(char** str)
{
*str = (char*) malloc(sizeof(char) *100) ;
}
int main(void)
{
char* str = NULL ;
GetMemory(&str) ;//动态申请内存
cout<<"请输入不超过长度的字符串:"<<MaxLength;
cout<<endl;
cin>>str;
cout<<"需要转换的原字符串是:"<<str;
conver(str) ;
cout<<endl;
cout<<"转换后的字符串是;"<<str<<endl;
free(str) ;//用完后释放内存
return 0 ;
}