『杭电1464』Telephone Numbers

Problem Description

Many New Zealand telephones now have letters printed in association with the digits. This allows firms and organisations to ``customise'' their telephone numbers by incorporating their name or some other word. Thus one might be able to obtain information on training as a nurse by dialling 0-800-NURSING, or find out about courses at local universities by dialling 0-800-4-OTAGOU or 0-800-AUCKUNI.

There are two related problems associated with this approach - one is relatively easy to solve while the other is a little more difficult. If one can elicit the cooperation of one's local telephone company, then one can merely purchase a suitable telephone number that matches your word. However, if you already have a telephone number, then one needs to find the `best' word that matches it.

Write a program that will do this. Input will be a list of words from a dictionary and a list of teleph

你可能感兴趣的:(#,杭电题库)