13970 - Frieren and her Rizz   

Description

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 :

  • If the signed bit is 1, make it lowercase
  • If the signed bit is 0, make it uppercase

The last 5 digits determine the number. Convert the number to a character, as:

  • Number 1 is ‘a’
  • Number 2 is ‘b’
  • Number 3 is ‘c’
  • and so on … until 26 as ‘z’

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: 

  • Number 1 is ‘z’
  • Number 2 is ‘y’
  • Number 3 is ‘x’
  • and so on … until 26 as ‘a’

Input

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

Output the encrypted character

Don't forget to print the new line

Sample Input  Download

Sample Output  Download

Tags




Discuss