#include <stdio.h>
#include <ctype.h>
int main(void)
{
int c, wassp;
wassp = 1;
while ((c = getchar()) != EOF) {
if (isspace(c))
wassp = 1;
else if (wassp) {
wassp = 0;
putchar(c);
}
}
putchar('\n');
return 0;
}
[guest@localhost c]$ .ansi t.c -o t
[guest@localhost c]$ echo "abcd efgh ijkl" | ./t
aei
[guest@localhost c]$