-->
当前位置:首页 > 题库 > 正文内容

PROGRAMMING:The sum of all digits within 1000 is a positive integer of n

Luz3年前 (2021-05-10)题库283
Output a positive integer whose sum of all digits within 1000 is n. for example, if the input n is 6, then the sum of all digits of 105 is 1 + 0 + 5 = 6, and the sum of all digits of 123 is 1 + 2 + 3 = 6, both of which meet the requirements. Each row outputs 6 columns, each integer occupies 8 bits, and the width is right aligned.
###Input format:
Enter the value of integer n from the keyboard.
###Output format:
Each row outputs 6 columns, each integer occupies 8 bits, and the width is right aligned. If the last row is less than 6 columns, you also need to wrap.
###Input example:
Here is a set of inputs. For example:
```in
six
```
###Output example:
The corresponding output is given here. For example:
```out
6 15 24 33 42 51
60 105 114 123 132 141
150 204 213 222 231 240
303 312 321 330 402 411
420 501 510 600
```







answer:If there is no answer, please comment

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。