I'm trying to solve the exercise 1.9 of the K&R book , 2nd edition , well I'll write here the exercise and then explain what I think that I need to do and then, my code and my doubts.

**Exercise:**

Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.

As far as I can understand, I need to make the program using what I learnt in the chapters before.

My view point is that I need to discover a way to say in the language of C that when appears more than one blank followed by another blank it will give me the phrase with only one blank. But how can I say to the computer that ?

```
#include <stdio.h>
/* ToDo - make a program where when the user input a phrase or
 * something that contains more than one blank followed by another
 * it will transform the input with only one blank */
int main()
{
    int c, b;
    b = ' ';        
    while ((c = getchar()) != EOF){ /*don't need explanation*/
        /*my doubts start here , how can i say more than one blank ?*/
        /* or how can i say if the getchar has  one blank followed by another ?*/

        if (c == +b) /* trying to say if the getchar has more than one blank but i think this is not correct*/
            c = b;   /*then it will turn in only one blank*/        
    }
    putchar(c);         
}

```