1 //反转I am a boy 为boy a am I 2 #include<iostream> 3 #include<string.h> 4 5 using namespace std; 6 7 void RS(char *begin,char *end) 8 { 9 while(begin<end) 10 { 11 swap(*end,*begin); 12 /*char temp=*begin; 13 *begin=*end; 14 *end=temp;*/ 15 begin++; 16 end--; 17 } 18 } 19 char *Reverse(char *s) 20 { 21 int len=strlen(s); 22 char *es=s+len-1; 23 RS(s,es); 24 char *p1=s; 25 char *p2=s; 26 //判断p2指针是否指向" "或" " 27 while(*p2 !='