题解 | #字符串反转#
字符串反转
http://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
字符串反转:C语言解法
#include<stdio.h>
int main(){
char c[1000] = {0};
int right=0, left = 0;
while(~scanf("%s\n",c)){
right = strlen(c)-1;
}
while(left<right){
char temp = c[left];
c[left++] = c[right];
c[right--] = temp;
}
printf("%s\n",c);
}