题解 | 反序输出

反序输出

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

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <map>
using namespace std;

int main() {
    char str[100];
    while (scanf("%s", str) != EOF) {
        int n = strlen(str);
        char str01[100];
        for (int i = n - 1; i >= 0; i--) {
            str01[n - i - 1] = str[i];
        }
        str01[n] = '\0';
        printf("%s\n", str01);
    }
    return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
11-14 16:15
已编辑
湖南工业大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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