将之前一段时间在牛客上刷的题给大家分享一下。其中一道题是“字符串反转”,接受一个只包含小写字母的字符串,然后输出该字符串反转后的字符串。(字符串长度不超过1000)

#include <stdlib.h>
#include <stdio.h>
int main()
{
char inputstream[1001]={0};
char outputstream[1001]={0};
scanf("%s",inputstream);
int len=strlen(inputstream);
int i =0;
for(i=0;i<len;i++)
{
outputstream[len-i-1]=inputstream[i];
}
printf("%s",outputstream);
return 0;
}