| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 10741 | The Encoded Word |
|
| 11581 | Push Push |
|
| 12008 | product of ascii |
|
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
Discuss
Description
Input will be four characters.
Please output the product of those ASCII value in one line.
Input:
ABCD
Output:
19545240
Input
4 Characters char belongs to {A,B,C,D,E} set.
Output
Value of the product
Note that you need to print ‘\n’ at the end of the output.