练习1-12 编写一个程序,以每行一个单词的形式打印其输入 #include <stdio.h> #define IN 1 #define OUT 0 int main(void) { int stats=0,a; while( (a=getchar()) !=EOF){ if(stats ==IN &&(a==' '||a=='/t'||a=='/n')){ stats=OUT; putchar('/n'); continue; } else if(a!=' ' &&a!='/t' &&a!='/n'){ putchar(a); stats=IN; } }/*end while*/ } |
练习1-12
最新推荐文章于 2022-10-27 22:57:41 发布