#include <stdio.h>
int main(void)
{
char ch;
printf("Enter a sentence (Enter + Ctrl-c to Exit): ");
ch = getchar();
while (ch != EOF)
{
if (ch==' ')
putchar(ch);
while (ch == ' ')
ch = getchar();
putchar(ch);
ch = getchar();
}
return 0;
}
/*
run:
Enter a sentence (Enter + Ctrl-c to Exit): c is on of the best
c is on of the best
*/