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

PROGRAMMING:Digital sum

Luz5年前 (2021-05-10)题库397
For a given positive integer n (2 ≤ n ≤ 50), find out all 4 or 5-digit integers, the sum of which is equal to N, and count the number of integers that meet the condition.
###Input format:
The input gives a positive integer n in one line, 2 ≤ n ≤ 50.
###Output format:
The first line outputs the number of 4-bit or 5-bit integers whose sum of digits is equal to N. the second line outputs these integers from small to large in the form of an integer followed by a space. If there is no such integer, output 0.
###Input sample 1:
```in
two
```
###Output sample 1:
```out
nine
1001 1010 1100 2000 10001 10010 10100 11000 20000
```
###Input sample 2:
```in
fifty
```
###Output sample 2:
```out
0
```







answer:If there is no answer, please comment