编程介的小学生
2017-11-27 15:39Magic WisKey
10Problem Description
On New Year Festival, Liu Qian’s magic impressed on little WisKey’s heart and he wants to learn some magic to make himself stronger.
One day, he met a cowman named LinLe. Linle is very nice, he told little WisKey the mysteries of magic. Now, little WisKey began to perform the magic to you.
“Hello, Everybody. I have five decimal numbers named a, b, c, d, e, (0 <= a, b, c, d, e <= 9) and I rearranged them, and then combined them into a number, for example = a*10000 + b*1000 + c*100 + d*10 + e*1. You know the number of permutations is 5! = 120. So you have 120 numbers in your hands, you can pick a number N from the 120 numbers and calculate the sum S of remain 119 numbers. AHA~, If you tell me the S, I can guess the N~!”
It’s easy? Okay, you can challenge this.
Input
Each line will contain an integer S. Process to end of file.
Output
For each case, output all possible N, print the number N with 5 digits, including the leading zeros, one line per case.
I promise every case have one solution at least. If have many N, please output them from small to large in one line, separate them with a blank space.
Sample Input
2933266
6392217
4245386
Sample Output
00038
07719
21238
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- 转到Appengine托管VM问题:未知标志-trimpath
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 1个回答
- 优先级和位掩码操作
- bitwise-operators
- bit-manipulation
- php
- 1个回答
- 将表中的许多行插入另一个表中的一个唯一行
- sql
- row
- foreach
- php
- mysql
- 1个回答
- 将子数组移动到父数组并更改父/子名称
- foreach
- arrays
- php
- 3个回答
- 使用javascript计算总价
- html
- javascript
- forms
- php
- 3个回答