BASE16 Encoding
Time limit1sMemory limit256 MB
Read a string of up to 50 letters and digits and print each character as two uppercase hex digits in order.
- Level
Easy1 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
Write a program that reads a string S and prints its BASE16 encoding.
The BASE16 encoding replaces each character of the string with its ASCII code, writes that code as a two digit hexadecimal number, and concatenates the results in order. The hexadecimal digits A to F are written in uppercase.
For example, the ASCII code of the character 'A' is 65, which is 41 in hexadecimal, so the BASE16 encoding of the string "A" is 41.
Input
The first line contains the string S. S consists only of uppercase letters, lowercase letters and digits, and its length is between 1 and 50.
Output
Print the BASE16 encoding of S on the first line.