-->
当前位置:首页 > 题库

PROGRAMMING:BCD decryption

Luz5年前 (2021-05-10)题库543
BCD number is a two digit decimal number expressed in one byte, and every four bits represent one bit. So if the hexadecimal of a BCD number is 0x12, it represents 12 in decimal system. But Xiaoming has never learned BCD, and he converted all BCD numbers into decimal output as binary numbers. So BCD's 0x12 is output to decimal 18!
Now, your program will read in the wrong decimal number and output the correct decimal number. Tip: you can convert 18 back to 0x12 and then back to 12.
###Input format:
Input a positive integer within the range of [0, 153] in one line to ensure that it can be converted back to a valid BCD number, that is, when the integer is converted to hexadecimal, there will be no A-F number.
###Output format:
Output the corresponding decimal number.
###Input example:
```in
eighteen
```
###Output example:
```out
twelve
```






answer:If there is no answer, please comment