题解 | 数组逆置

#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;
}

字符串%c,数组%s

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

相关推荐

05-12 17:28
已编辑
门头沟学院 硬件开发
ldf李鑫:不说公司名祝你以后天天遇到这样的公司
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务