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

PROGRAMMING:Kabulek constant (Cixi, 2010)

Luz3年前 (2021-05-10)题库498
Recently, Xiao Bo learned about the "kabulek constant" in the interest course of mathematics. Kabulek is a mathematician. When he studied numbers, he found that: if any four digit number is not composed of exactly the same number, if each digit of them is reordered to form a maximum number and a minimum number, then subtract the minimum number from the maximum number, and fill in zero when the difference is less than four digits, and so on, it will finally become a fixed number: 6174, That's the cablek constant.
For example: 4321-1234 = 3087
     8730-378=8352
     8532-2358=6174
     7641-1467=6174
……
Xiao Bo thought, can I program to verify it? Enter a qualified four digit number, and then verify the operation process.
###Input format:
A total of 1 line, for any one is not composed of exactly the same number of four digits.
###Output format:
The operation process of changing into a kabulek constant is composed of several lines, each line is an expression without spaces.
###Input example:
```in
four thousand three hundred and twenty-one
```
###Output example:
```out
4321-1234=3087
8730-378=8352
8532-2358=6174
```






answer:If there is no answer, please comment

发表评论

访客

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