Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.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

68 lines
1.8 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.

---
title: Iterated digits squaring
id: 5a23c84252665b21eecc7ec1
challengeType: 5
videoUrl: ''
localeTitle: 迭代的数字平方
---
## Description
<section id="description">如果添加自然数大于零的整数的数字的平方则始终以1或89结尾 <pre> 15 - &gt; 26 - &gt; 40 - &gt; 16 - &gt; 37 - &gt; 58 - &gt; 89
7 - &gt; 49 - &gt; 97 - &gt; 130 - &gt; 10 - &gt; 1 </pre>编写一个函数该函数将数字作为参数并在执行上述过程后返回1或89。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>iteratedSquare</code>应该是一个函数。
testString: assert(typeof iteratedSquare=='function');
- text: <code>iteratedSquare(4)</code>应该返回一个数字。
testString: assert(typeof iteratedSquare(4)=='number');
- text: <code>iteratedSquare(4)</code>应该返回<code>89</code> 。
testString: assert.equal(iteratedSquare(4),89);
- text: <code>iteratedSquare(7)</code>应该返回<code>1</code> 。
testString: assert.equal(iteratedSquare(7),1);
- text: <code>iteratedSquare(15)</code>应该返回<code>89</code> 。
testString: assert.equal(iteratedSquare(15),89);
- text: <code>iteratedSquare(20)</code>应该返回<code>89</code> 。
testString: assert.equal(iteratedSquare(20),89);
- text: <code>iteratedSquare(70)</code>应该返回<code>1</code> 。
testString: assert.equal(iteratedSquare(70),1);
- text: <code>iteratedSquare(100)</code>应该返回<code>1</code> 。
testString: assert.equal(iteratedSquare(100),1);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function iteratedSquare (n) {
// Good luck!
}
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>