Project-Scylla/KNR C/ex1_9.c

29 lines
275 B
C
Raw Permalink Normal View History

#include <stdio.h>
int main(){
int a = getchar();
int state = 0;
while (a != EOF){
if (state == 1){
if (a != ' '){
putchar (a);
}
} else {
putchar(a);
}
if (a == ' '){
state = 1;
} else {
state = 0;
}
a = getchar();
}
return 0;
}