diff --git a/KNR C/ex1_9.c b/KNR C/ex1_9.c new file mode 100644 index 0000000..6508533 --- /dev/null +++ b/KNR C/ex1_9.c @@ -0,0 +1,28 @@ +#include + +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; +}