In countries like USA, is usual that the advertisers give their telephone using letters instead of numbers. For instance, a painter can say that his “number” is 1-800-PAINTER. Thanks to the dials like the one in the figure, when a person use this “number”, actually dials 1-800-7246837.
Write a program that reads a “number” of telephone that includes letters and converts it to the equivalent number that only contains numbers.
Input is a “number” of telephone that can include uppercase letters, dashes and digits.
The output is the equivalent number of telephone, preserving its dashes.
Use a function to return the corresponding number to each letter.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:21:07.779Z
© Jutge.org, 2006–2026.
https://jutge.org