-->
当前位置:首页 > 题库

PROGRAMMING:Arithmetic problems of CZY

Luz5年前 (2021-05-10)题库465
CZY's family has a unique dog, called a seal. The sea dog is very smart. On this day CZY found that the sea dog was studying arithmetic, so he decided to test the sea dog. CZY gave n (0 < n < 9) numbers (all single digits) to the sea dogs and asked them to work out the sum of them arranged according to certain rules. Can you help the seal?
The rules are as follows
If shilling n = 5, and then input a B C D E, then the value of ABCDE + bcdea + cdeab + deabc + eabcd is obtained, which is the output number.
example
Input 5 1 2 3 4 5
At this point n = 5, we calculate 12345 + 23451 + 34512 + 45123 + 51234 to get 166665, output.
###Input format:
Input n in the first line and N digits in the second line
###Output format:
Acceptable value
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 3 4 5
three
1 2 3
```
###Output example:
The corresponding output is given here. For example:
```out
one hundred and sixty-six thousand six hundred and sixty-five
six hundred and sixty-six
```







answer:If there is no answer, please comment