英文原题,捆扰我好几天了,还是没头绪
Write a program that finds and dispalys all pairs of 5-digit numbers that between them use the digits 0 through 9 once each,such that the first number divied by the second is equal to an integer N, where 2=<N<=79.That is: abcde/fghij=N
Where each letter represents a different digit.The first digit
of one of the numerals allowed to be zero.
Input:
Each line of the input file consists of a valid integer N. An input of zero is to terminate the program.
Output:
Your program have to dispaly All qualifying pairs of numerals, sorted by increasing numerals,sorted by increasing numerator(and of course, denominator).
Your output should be in the following general form:
xxxxx / xxxxx = N
xxxxx / xxxxx = N
In case there are no pairs of numerals satisfying the condition, you must write "There are no solutions for N."Separate the output for two different values of N by a blank line.
Sample Input:
61
62
0
Sample Output:
There are no solutions for 61.
79546 / 01283 = 62
94736 / 01528 = 62
只求个算法,谢谢!
Where each letter represents a different digit.The first digit
of one of the numerals allowed to be zero.
Input:
Each line of the input file consists of a valid integer N. An input of zero is to terminate the program.
Output:
Your program have to dispaly All qualifying pairs of numerals, sorted by increasing numerals,sorted by increasing numerator(and of course, denominator).
Your output should be in the following general form:
xxxxx / xxxxx = N
xxxxx / xxxxx = N
In case there are no pairs of numerals satisfying the condition, you must write "There are no solutions for N."Separate the output for two different values of N by a blank line.
Sample Input:
61
62
0
Sample Output:
There are no solutions for 61.
79546 / 01283 = 62
94736 / 01528 = 62
只求个算法,谢谢!
...全文
相关推荐
中学教师资格证笔试科目三-《学科知识与教学能力》一点没头绪?重点都给你了!.pdf
中学教师资格证笔试科目三-《学科知识与教学能力》一点没头绪?重点都给你了!.pdf
smc-lecsa电缸控制器设置操作
smc lecsa 电缸控制器smc 就没有官网的中文说明书,找台湾版本的又没头绪,电话找smc技术支持要了一份新作的文档,希望能帮到大家。
精品(2021-2022年)资料逻辑推理题常用的解法与解题思路.doc
**总结**同一律和不矛盾律作为解决逻辑推理题的重要工具,能帮助我们在复杂的陈述和信息中理清头绪,找到真实的结论。
记一次Ubuntu服务器被黑经历
起因最近我们的一台Ubuntu阿里云服务器一直提示有肉鸡行为,提示了好几天,开始并没有关注,然后连续几天后发现应该是个大问题啊。很可能服务被侵入了!!!寻找线索一开始我是完全懵逼的状态的,Linux不
互联网英文求职信范文.doc
**分析能力和团队合作**:求职者展示了自己的分析技能和团队精神,表明能从混乱中理出头绪,与团队成员协作。5.


新手乐园
