chore(learn): Applied MDX format to Chinese curriculum files (#40462)
This commit is contained in:
@ -1,66 +1,39 @@
|
||||
---
|
||||
id: 597f1e7fbc206f0e9ba95dc4
|
||||
title: 整数因子
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
title: 整数因子
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id="description"><p>编写一个返回正整数因子的函数。 </p><p>这些因子是正整数,通过该正整数可以将被分解的数量除以产生正整数结果。 </p> /// </section>
|
||||
# --description--
|
||||
|
||||
## Instructions
|
||||
<section id="instructions">
|
||||
</section>
|
||||
<p>编写一个返回正整数因子的函数。 </p><p>这些因子是正整数,通过该正整数可以将被分解的数量除以产生正整数结果。 </p> ///
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
# --hints--
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>factors</code>是一种功能。
|
||||
testString: assert(typeof factors === 'function');
|
||||
- text: '<code>factors(45)</code>应该返回<code>[1,3,5,9,15,45]</code> 。'
|
||||
testString: assert.deepEqual(factors(45), ans[0]);
|
||||
- text: '<code>factors(53)</code>应该返回<code>[1,53]</code> 。'
|
||||
testString: assert.deepEqual(factors(53), ans[1]);
|
||||
- text: '<code>factors(64)</code>应该返回<code>[1,2,4,8,16,32,64]</code> 。'
|
||||
testString: assert.deepEqual(factors(64), ans[2]);
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
<div id='js-seed'>
|
||||
`factors`是一种功能。
|
||||
|
||||
```js
|
||||
function factors (num) {
|
||||
// Good luck!
|
||||
}
|
||||
|
||||
assert(typeof factors === 'function');
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
### After Test
|
||||
<div id='js-teardown'>
|
||||
`factors(45)`应该返回`[1,3,5,9,15,45]` 。
|
||||
|
||||
```js
|
||||
console.info('after the test');
|
||||
assert.deepEqual(factors(45), ans[0]);
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
`factors(53)`应该返回`[1,53]` 。
|
||||
|
||||
```js
|
||||
// solution required
|
||||
assert.deepEqual(factors(53), ans[1]);
|
||||
```
|
||||
|
||||
/section>
|
||||
`factors(64)`应该返回`[1,2,4,8,16,32,64]` 。
|
||||
|
||||
```js
|
||||
assert.deepEqual(factors(64), ans[2]);
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
|
Reference in New Issue
Block a user