#include #include #define START 97 //ASCII value of 'a' int main() { char word[5]; //initial string to start with char strlist[25*5][5]; //array to store new strings derived from "word" char c1, c2; int i, j, count; printf("Please input a 5-letter word: "); scanf("%s", word); printf("\n Generating new stirngs from %s: \n", word); count = 0; //generate 25*5 new strings which differ from word in 1 letter for(i = 0; i < 5; i++) { c1 = word[i]; //process the ith letter in word for(j = 0; j< 26; j++) { c2 = j + START; if( c2 == word[i]) //only use letter different from word[i] continue; strcpy(strlist[count], word); strlist[count][i] = c2; printf("string %d: %s\n", count, strlist[count]); count++; } } return 0; }