题解 | 数组逆置

#include <stdio.h>

int main() {
    char a[1000];
    while (scanf("%s", &a) != EOF) { // 注意 while 处理多个 case
    int length=strlen(a);
      for(int i=length-1;i>=0;i--){
        printf("%c",a[i]);
      }
    }
    return 0;
}

字符串%s

字符%c

全部评论
so easy
点赞 回复 分享
发布于 2025-02-02 15:30 重庆

相关推荐

评论
点赞
收藏
分享

创作者周榜

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