that seems to lend itself to a recursive solution.
have a function that takes a string (char *) as input
Code:
if the input is 0 (end of string), return
ch = first character in the string
for each number that ch as associated with it (could be one or more)
print the number
recursively call the function with the remaining characters
then the issue is how to determine the numbers that are associated with each letter. for starters I would just use 'ifs' or 'switch' on the characters to get something working. then you could concoct a data structure that tells you the numbers for a given letter.