1-9

OKOK

#include <stdio.h>

/*
 * 2つ以上の空白を1つの空白に置き換えながら
 * 入力を出力に複写する
 **/
main(){
	int c,beforec;

	while((c = getchar() ) != EOF){
		if (c != ' ' ){
			if(beforec == ' '){
				putchar(beforec);
			}
			putchar(c);
		}
		beforec = c;
	}
	exit(0);
}
:!gcc 1-9.c && ./a.out
[No write since last change]
aaaa  bbb
aaaa bbb
a  b c     d
a b c d
^D
Press ENTER or type command to continue