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

PROGRAMMING:Time stealer

Luz5年前 (2021-05-10)题库388
Haigou used to be a thief in Wangxing. After arriving at the earth, the seal heard the song "time stealer" and was very moved, so he decided to come back. Sea dogs like to go to Wangzai shopping mall to find targets. Every commodity in Wangzai shopping mall has its own ID, and all IDs are integers. We call the sum of the digits in each ID "commodity number".
Because of professional ethics, the seal wants to steal as many goods as possible. However, if the sum of ID and digits of various commodities is the same (that is, the "commodity number" is the same), only one commodity will be stolen.
For example, the commodities with ID 123 and ID 51 satisfy this condition, because 1 + 2 + 3 = 5 + 1 = 6.
Given some commodity ID, you are required to calculate how many commodities the seal will take away from these commodities, and output the "commodity number" of these commodities in increasing order.
###Input format:
The first line of each group gives a positive integer n, which represents the number of commodity ID given.
The next line gives n positive integers separated by spaces.
Make sure all numbers are less than 10 ^ 4. There are many groups of data.
###Output format:
The first line of each group outputs the number of different commodity numbers in the given number;
The next line outputs these commodity numbers in increasing order, with a space between the numbers, and no extra space at the end of the line.
###Input example:
Here is a set of inputs. For example:
```in
eight
123 899 51 998 27 33 36 12
one
one
```
###Output example:
The corresponding output is given here. For example:
```out
four
3 6 9 26
one
one
```







answer:If there is no answer, please comment