字符串反转;直接反向逐个输出;C语言

字符串反转

http://www.nowcoder.com/questionTerminal/e45e078701ab4e4cb49393ae30f1bb04

#include <stdio.h>
#include <string.h>

// 直接反向输出

int main()
{
    char s[1001]="";
    while(scanf("%s",s)!=EOF){
        int len,i;
        len = strlen(s);
        for(i=len-1; i>=0; i--){
            printf("%c",s[i]);
        }
        printf("\n");
    }

    return 0;
}
全部评论

相关推荐

点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务