2013年9月17日

练习1-12:编写一个程序,以每行一个单词的形式打印其输入(C程序设计语言 第2版)

摘要: #include #define NOT_BLANK 1#define BLANK 0main(){ int c; int last_ch = NOT_BLANK; while ((c=getchar()) != EOF){ if (c == ' ' || c == '\n' || c == '\t'){ if (last_ch == NOT_BLANK) putchar('\n'); last_ch = BLANK;//这条语句可以包括在最近的if里面 }else{ ... 阅读全文
posted @ 2013-09-17 10:48 Samuel Yang 阅读(303) 评论(0) 推荐(0) 编辑