C语言:编写一个程序,以每行一个单词的形式打印其输入 第二版《C程序设计语言》,P15,练习1-12。 自己实现的代码如下: #include <stdio.h> #define IN 1 #define OUT 0 main() { int c, state; state = OUT; while((c = getchar()) != EOF) { if (c == ' ' || c == '\t 未分类 桩白墨 2015-03-09 1 热度 0评论
c语言:编写一个将输入复制到输出的程序,并将其中的多个空格用一个空格代替 第二版《C程序语言设计》,P13,练习1-9。 #include <stdio.h> /* count lines in input */ int main() { int c, pc; /* c = character, pc = previous character */ /* set pc to a value that wouldn't matc 未分类 桩白墨 2015-03-09 2 热度 0评论