c++
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char s[] = "abcdefghigklmnopqrstuvwxyz";
char c;
for(int i=0,j=strlen(s)-1;i<j;++i,--j)
{
c = s[i];
s[i] = s[j];
s[j] = c;
}
for(int n=0; n<strlen(s);n++)
{
cout<< s[n];
}
}
将第1个与最后一个替换 第二个与倒数第二个替换 一直到中间为止