825 - I2P(I)2015_Lee_LAB_2 Scoreboard

Time

2015/10/08 13:40:00 2015/10/08 15:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
10741 The Encoded Word

10741 - The Encoded Word   

Description

The input is a three-digit integer N that consists of digits 1-9 except 0. The task is to use the following rule to encode the input number:

First digit =>  even: 'A', odd: 'B'
Second digit => even: 'C', odd: 'D'
Third digit => even: 'E', odd: 'F'

For example, if the input is 489, the output should be  ACF because 4 is even, 8 is even, and 9 is odd.

Hints:
1. Given an integer x and two values M and N, we can use the following equation to select one of M and N according to x being even or odd.

           y = (x%2)*M + ((x+1)%2)*N;

That is, if x is odd, y will have value M; if x is even, y will get value N.

2. Characters like 'A', 'B', 'C' are constant values. We can use them in computations such as 0*'A' + 1*'B' or 'D' - 'A'.

Input

A three-digit integer consisting of only 1-9 but not 0

Output

The encoded three-letter word.
Note that you do not need to print ‘\n’ at the end of the output.

Sample Input  Download

Sample Output  Download

Tags

10401Contest



Discuss