Telephones P56109


Statement
 

pdf   zip

html

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

Input is a “number” of telephone that can include uppercase letters, dashes and digits.

Output

The output is the equivalent number of telephone, preserving its dashes.

Observation

Use a function to return the corresponding number to each letter.

Public test cases
  • Input

    1-800-PAINTER
    

    Output

    1-800-7246837
    
  • Input

    802-PONME-CALIENTE
    

    Output

    802-76663-22543683
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++