notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly the numbers from 1 to 9, only in a different permutation. check to see the result if we double it again! now you are suppose to check if there are more numbers with this property. that is, double a given number with k digits, you are to tell if the resulting number consists of only a permutation of the digits in the original number.
时间: 2023-04-21 07:01:58 浏览: 134
Enter a three-digit number to determine whether the number is a
注意,数字123456789是一个由数字1到9组成的9位数,没有重复。将它翻倍,我们将得到246913578,这恰好是另一个由数字1到9组成的9位数,只是排列不同。现在你应该检查如果我们再次将其翻倍的结果是什么!现在你应该检查是否还有更多具有此属性的数字。也就是说,将一个有k位数字翻倍,你需要判断结果数字是否只由原始数字的排列组成。
阅读全文