反转一个字符串
void reverse( char * str) {
2 char tmp;
3 int len;
4 len = strlen(str);
5 for ( int i = 0 ;i < len / 2 ; ++ i) {
6 tmp = str [i];
7 str[i] = str[len - i - 1 ];
8 str[len - i - 1 ] = tmp;
9 }
10 }
2 char tmp;
3 int len;
4 len = strlen(str);
5 for ( int i = 0 ;i < len / 2 ; ++ i) {
6 tmp = str [i];
7 str[i] = str[len - i - 1 ];
8 str[len - i - 1 ] = tmp;
9 }
10 }