Frieren wants to steal Josh's heart,
but Josh is a CS student, so he locked his heart with a password encrypted in binary
Can you help Frieren to decrypt the password?
Given a 6-digit binary, help her to encrypt the password to a character.
The first digit is a signed bit, as per the rules :
The last 5 digits determine the number. Convert the number to a character, as:
All of them are based on alphabetic order.
A quick guide to convert 5 digits binary to integer, 01010 represents 10:
An ASCII table to help you figure out this problem :
Explanation of sample input :
010010 split into 0 and 10010
The signed bit is 0, which means it’s uppercase
10010 is 18, which is R in alphabetical order.
Follow-up: Can you do it without if-else?
Follow-up 2: How will you solve it if the character is assigned in the reverse order? Maybe it'll appear in your lab next Monday!
Follow-up 2 Example:
Input is 6 digit binary representation number (contain 1 or 0)
You can safely asume that the number is in the range 1 <= X <= 26
You might see the sample input if the description is not clear enough
Output the encrypted character
Don't forget to print the new line