#include #include char *word2(char *s1) { char *x; x = strchr(s1, ' '); if (x == NULL) return x; while (*x == ' ') x++; if (*x == '\0') return NULL; return x; } main() { char s1[100]; char *x; while(gets(s1) != NULL) { for (x = s1; x != NULL; x = word2(x)) { printf("%s\n", x); } } }