freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-192-best-approximat...

56 lines
1.2 KiB
Markdown
Raw Normal View History

---
id: 5900f42c1000cf542c50ff3f
challengeType: 5
title: 'Problem 192: Best Approximations'
videoUrl: ''
localeTitle: 问题192最佳近似值
---
## Description
<section id="description">设x是实数。对于分母界限dx的最佳近似是简化形式的有理数r / s其中s≤d使得任何比r更接近x的有理数具有大于d的分母 <p> | P / QX | &lt;| r / sx | ⇒q&gt; d </p><p>例如分母界限20的最佳近似值√13为18/5分母界限30的最佳近似值为√13为101/28。 </p><p>找到分母1012的最佳逼近的所有分母的总和为√n其中n不是完美的正方形1 &lt;n≤100000。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler192()</code>应该返回57060635927998344。
testString: 'assert.strictEqual(euler192(), 57060635927998344, "<code>euler192()</code> should return 57060635927998344.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler192() {
// Good luck!
return true;
}
euler192();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>