Numbers (找规律)

Let us call P(n) – the product of all digits of number n (in decimal notation).For example, P(1243)=1*2*4*3=24; P(198501243)=0.Let us call n to be a good number, if (p(n)<>0) and (n mod P(n)=0).Let us call n to be a perfect number, if both n and n+1 are good numbers.You are to write a program, which, given the number K, counts all suchnumbers n that n is perfect and n contains exactly K digits in decimal notation.

,人生就是要感受美丽的善良的,丑恶的病态的。

Numbers (找规律)

相关文章:

你感兴趣的文章:

标签云: