#K45447. Pentar to Decimal Conversion
Pentar to Decimal Conversion
Pentar to Decimal Conversion
You are given a number represented in the Pentar system, where each digit is given as an English word. The conversion is based on the following mapping:
- \(\text{Zero} \to 0\)
- \(\text{One} \to 1\)
- \(\text{Two} \to 2\)
- \(\text{Three} \to 3\)
- \(\text{Four} \to 4\)
Your task is to convert the given Pentar number into its corresponding decimal number. The input begins with an integer \(n\) which denotes the number of words (digits) that follow. The next line contains \(n\) space-separated words representing the number in the Pentar numeral system. You are to output the decimal number obtained by mapping each word to its corresponding digit and concatenating them.
Note: The output should be printed to the standard output.
inputFormat
The input consists of two lines:
- The first line contains an integer (n) representing the number of Pentar digits.
- The second line contains (n) space-separated words. Each word is one of: Zero, One, Two, Three, or Four.
outputFormat
Output a single integer which is the decimal representation obtained after converting the given Pentar number.## sample
3
One Zero Four
104