Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.
#include <stdio.h> void main() { int c,c_BCN; while((c=getchar())!=EOF) { if(c!=' ') c_BCN=0; if(c==' ') ++c_BCN; if(c_BCN<=1) putchar(c); } printf("\n%d\n",c); }
df ff f f fff d fg fgg
df ff f f fff d fg fgg
![](https://files.cnblogs.com/files/wjshan0808/0.bmp)