freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-156-counting-digits.md

56 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4091000cf542c50ff1b
challengeType: 5
videoUrl: ''
localeTitle: 问题156计数数字
---
## Description
<section id="description">从零开始自然数字在基数10中写下如下所示 <p> 0 1 2 3 4 5 6 7 8 9 10 11 12 .... </p><p>考虑数字d = 1。在我们写下每个数字n后我们将更新已发生的数字并将此数字称为fn1。那么fn1的第一个值如下 </p><p> nfn100 11 21 31 41 51 61 71 81 91 102 114 125 </p><p>请注意fn1永远不等于3。 </p><p>因此等式fn1= n的前两个解是n = 0并且n = 1。下一个解决方案是n = 199981。以相同的方式函数fnd给出在写入数字n之后已经写下的总位数d。 </p><p>实际上对于每个数字d≠0,0是方程fnd= n的第一个解。设sd是fnd= n的所有解的总和。 </p><p>你得到s1= 22786974071。找到Σsd的1≤d≤9。注意如果对于某些n对于多于一个d的值fnd= n对于d的每个值再次计算n的这个值。 FNd= N。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler156</code>应该返回21295121502550。
testString: assert.strictEqual(euler156(), 21295121502550);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler156() {
// Good luck!
return true;
}
euler156();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>