Come up with the algorithm first. It may be easier if you assume that the input is entirely lowercase and consists only of characters in the English alphabet. Later, extend your algorithm to handle non-alphabetic input. Handling uppercase is easy since tolower from <ctype.h> can be used to convert from uppercase to lowercase.
Then, when you have an algorithm that you think will work, implement it. Do not worry about input at first: just hard code the strings, e.g.,
Code:
const char input[] = "a bC_df g";
After you have everything working except the input part, implement the reading of input.