Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-17-number-letter-counts.chinese.md

60 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: 5900f37d1000cf542c50fe90
challengeType: 5
title: 'Problem 17: Number letter counts'
videoUrl: ''
localeTitle: 问题17数字字母计数
---
## Description
<section id="description">如果数字1到5用文字写出则总共使用3 + 3 + 5 + 4 + 4 = 19个字母。如果从1到包含<code>limit</code>所有数字都用文字写出,那么会使用多少个字母? <b>注意:</b>不要计算空格或连字符。例如342三百四十二包含23个字母115一百一十五包含20个字母。在写出数字时使用“和”符合英国的用法。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>numberLetterCounts(5)</code>应返回19。
testString: 'assert.strictEqual(numberLetterCounts(5), 19, "<code>numberLetterCounts(5)</code> should return 19.");'
- text: <code>numberLetterCounts(150)</code>应该返回1903。
testString: 'assert.strictEqual(numberLetterCounts(150), 1903, "<code>numberLetterCounts(150)</code> should return 1903.");'
- text: <code>numberLetterCounts(1000)</code>应该返回21124。
testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, "<code>numberLetterCounts(1000)</code> should return 21124.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function numberLetterCounts(limit) {
// Good luck!
return true;
}
numberLetterCounts(5);
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>