Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-21-amicable-numbers.chinese.md
Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

62 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f3811000cf542c50fe94
challengeType: 5
title: 'Problem 21: Amicable numbers'
videoUrl: ''
localeTitle: 问题21友好的数字
---
## Description
<section id="description">设d <var>n</var> )定义为<var>n</var>的适当除数之<var></var> (小于<var>n的</var>数均匀分成<var>n</var> 。如果d <var>a</var> = <var>b</var>并且d <var>b</var> = <var>a</var> ,其中<var>a</var><var>b</var> ,则<var>a</var><var>b</var>是友好对,并且<var>a</var><var>b</var>中的每<var>一个</var>被称为友好数字。例如220的适当除数是1,2,4,5,10,11,20,22,44,55和110;因此d220= 284. 284的适当除数是1,2,4,71和142;所以d284= 220.评估<var>n</var>下所有友好数字的总和。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>sumAmicableNum(1000)</code>应返回504。
testString: assert.strictEqual(sumAmicableNum(1000), 504);
- text: <code>sumAmicableNum(2000)</code>应该返回2898。
testString: assert.strictEqual(sumAmicableNum(2000), 2898);
- text: <code>sumAmicableNum(5000)</code>应该返回8442。
testString: assert.strictEqual(sumAmicableNum(5000), 8442);
- text: <code>sumAmicableNum(10000)</code>应返回31626。
testString: assert.strictEqual(sumAmicableNum(10000), 31626);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function sumAmicableNum(n) {
// Good luck!
return n;
}
sumAmicableNum(10000);
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>