题解 | #反序输出#

反序输出

https://www.nowcoder.com/practice/171278d170c64d998ab342b3b40171bb

#include <stdio.h>
#include <string.h>
int main(){
    char str[20];
    while (scanf("%s", str) != EOF){
        int len = strlen(str);
        for (int i = len-1; i >= 0; --i) {
            printf("%c", str[i]);
        }
        printf("\n");
    }
    return 0;
}

全部评论

相关推荐

重生我想学测开:嵌入式的问题,我准备入行京东外卖了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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