Your task is to write a program that computes the value of a given message. To compute it, we will consider that only the letters have value, and that each letter has greater value the more infrequent it is, as can be seen in this table:
| Valor | Letras |
|---|---|
| 1 | a e |
| 2 | o s |
| 3 | d i n r |
| 4 | c l t u |
| 5 | m p |
| 6 | b f g h j q v x y z |
| 7 | k w |
The input consists of a sequence of characters, which include exclusively lowercase letters, spaces and newlines.
Your program must print the total value of the message, computed as the sum of the value of all its letters.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:31:07.834Z
© Jutge.org, 2006–2026.
https://jutge.org