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

PROGRAMMING:A+B(Ⅰ)

Luz5年前 (2021-05-10)题库356
$$bear after unemployment\_ He can only make a living by logging every day. Except logging, he can only play with his firestick. Today, he wants to put all the sticks together into two decimal numbers $$a, B $$.
The composition of each number is as follows:
![ 1.png](~/75255c79-17b4-4f86-b814-8400d82e3bb5.png)
From 0 to 9, you need $$6,2,5,5,4,5,6,3,7,6 $$sticks respectively
Now what's the maximum $$a + B $
###Input format:
In the first line, enter the number of sample groups $$t (1 < = T < = 100) $,
In the next $$t $$line, each line has a positive integer $$n (4 < = n < = 100000) $, representing $$bear$$_$$ 2 $$has $$n $$sticks.
Ensure that the sum of $$n $$in all samples does not exceed $$1000000$$
###Output format:
For each set of input data, output the maximum value of $$a + B $$in one row.
###Input example:
```in
six
four
five
six
seven
eight
nine
```
###Output example:
```out
two
eight
twelve
seventy-two
one hundred and twelve
seven hundred and twelve
```
###Tips:
4 sticks, a = 1, B = 1
5 sticks, a = 7, B = 1
6 sticks, a = 11, B = 1







answer:If there is no answer, please comment