\"Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.\"
I\'m assuming by thi
/*a program that copies its input to its output, replacing each string of one or more blanks by a single blank*/
#include
#include
int main(void)
{
double c;
char blank = ' ';
while((c = getchar()) != EOF)
{
if(c == ' ')
{
putchar(c);
while(( c = getchar() )== ' ')
{
if(c != ' ')
break;
}
}
if(c == '\t')
{
putchar(blank);
while((c = getchar()) == '\t')
{
if(c != '\t')
break;
}
}
putchar(c);
}
return 0;
}