题解 | #字符串反转#
字符串反转
https://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
#include <stdio.h>
#include <string.h>
int main() {
char str[1000];
gets(str);
int len=strlen(str);
int high=len-1;
int low=0;
while(high>low)
{
char flag=str[low];
str[low]=str[high];
str[high]=flag;
low++;
high--;
}
printf("%s",str);
}
