题解 | #字符串反转#

字符串反转

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

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

int main (void)
{
    int str_len,j = 0;
    char input[1000];
    char output[1000];
    while(~ scanf("%s",input));
    {
        str_len = strlen(input);
        for(int i = str_len-1;i>=0;i--)
            output[j++] = input[i];
        output[j++] = '\0';
        printf("%s",output);
    }
    return 0;
}

全部评论

相关推荐

2025-11-05 15:40
已编辑
杭州电子科技大学 网络安全
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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