/** * 反转字符串 * @param str string字符串 * @return string字符串 */ char* solve(char* str ) { // write code here char *p1=str; char *p2=str; int temp=0; while (*p2!='\0') { p2++; } p2--; while (p1<p2) { temp=*p1; *p1=*p2; *p2=temp; p1++; p2--; } return str; }