题解 | #单词倒排#

单词倒排

https://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836

#include<stdio.h>
#include<stdlib.h>

int main(){
    char str[100][22];//单词倒排必须是二位数组,第一个是单词的序号,第二个事单词本身的内容
    int i = 0;
    int x;
    while(1){
        x = scanf("%[a-z|A-Z]",str[i]);
        if(getchar()=='\n') break;//这里表示读到\n就结束
        if(x) i++;
    }
    for(int j=i;j>=0;j--){
        printf("%s ",str[j]);
    }
    return 0;
}

全部评论

相关推荐

05-29 22:11
门头沟学院 Java
Elastic90:抛开学历造假不谈,这公司的招聘需求也挺怪的,Java开发还要求你有图文识别、移动端开发和c++的经验,有点逆天了。
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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