字符逆序

Problem Description
将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符。
Input
输入包括一行。
第一行输入的字符串。
Output
输出转换好的逆序字符串。
Sample Input
I am a student
Sample Output
tneduts a ma I

#include<stdio.h>
#include<string.h>
int main()
{
char s[101],i;
gets(s);
for(i=strlen(s)-1; i>=0; i–)
{
printf("%c",s[i]);
}
return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_44370461/article/details/85788110