题解 | #字符串反转#
字符串反转
http://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
#include<stdio.h>
int main()
{
char str[1000] = {'0'};
while(~scanf("%s",&str))
{
int len = strlen(str);
for(int i = len-1; i >= 0; i--) //逆向循环
{
printf("%c",str[i]); //逆向输出
}
printf("\n");
}
return 0;
}