123456789101112131415161718192021222324252627282930313233343536// Goal - convert words coming in to a format// suitable for word counts - strip leading and trailing// non-alpha characters and convert to lower case.#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>int main(int argc, char *argv[]) {// read from stdin, write to stdoutchar s[100];while (scanf("%99s", s) == 1) {char *begin = s, // first character*end = s + strlen(s); // terminating NULL character// remove leading non-alphawhile (! isalpha(*begin) && begin < end)begin++;// remove trailing non-alphawhile (end > begin && !isalpha(*(end-1))) {end--; *end = '\0';}// convert to lower casefor(int i=0; begin[i] != '\0'; i++)begin[i] = tolower(begin[i]);if (strlen(begin) > 0)printf("%s\n", begin);}