PAT.Basic Level. T.1009.说反话

来源:互联网 发布:淘宝客服兼职靠谱吗 编辑:程序博客网 时间:2024/05/05 02:15

首先,这是一道瓜皮题,我刚开始还以为,要每个单词每个单词读入然后一个一个记录字母的去做。后来他喵的发现,直接每个都当字符串整个整个输入就好了啊… 然后倒序循环一下输出就得了… 哇,很难受。

#include<stdio.h>main(){    char input[85][85];    int i,temp1;    char ch;     temp1=0;    do{         temp1++;         scanf("%s",&input[temp1][0]);    }while((ch=getchar())!='\n');    for(i=temp1;i>1;i--){        printf("%s ",input[i]);    }    printf("%s",input[i]);    return 0;}
0 0
原创粉丝点击