编程介的小学生 2019-08-04 22:01 采纳率: 20.5%
浏览 150

如何采用的C语言的代码实现这里的Magic WisKey的计算

Problem 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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
    • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序