2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
id: 5900f3b31000cf542c50fec6
|
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2020-10-01 17:54:21 +02:00
|
|
|
|
title: 问题71:有序分数
|
2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id="description">考虑分数,n / d,其中n和d是正整数。如果是<d 1="" 2="" 3="" 4="" 5="" 6="" 7="" 8="" and="" hcf(n,d)="1," it="" is="" called="" a="" reduced="" proper="" fraction.="" if="" we="" list="" the="" set="" of="" fractions="" for="" d="" ≤="" in="" ascending="" order="" size,="" get:="" 8,="" 7,="" 6,="" 5,="" 4,="" 3,="" 2,="" can="" be="" seen="" that="" fraction="" immediately="" to="" left="" 7.="" by="" listing="" 1,000,000="" find="" numerator="" <="" section=""><h2>说明</h2><section id="instructions"></section><h2>测试</h2><section id="tests"><pre> <code class="language-yml">tests: - text: <code>euler71()</code> should return 428570. testString: 'assert.strictEqual(euler71(), 428570, "<code>euler71()</code> should return 428570.");'</code> </pre></section><h2>挑战种子</h2><section id="challengeSeed"><div id="js-seed"><pre> <code class="language-js">function euler71() { // Good luck! return true; } euler71();</code> </pre></div></section><h2>解</h2><section id="solution"><pre> <code class="language-js">// solution required</code> </pre></section></d></section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id="instructions">
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler71()</code>应返回428570。
|
|
|
|
|
testString: 'assert.strictEqual(euler71(), 428570, "<code>euler71()</code> should return 428570.");'
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler71() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler71();
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2020-08-13 17:24:35 +02:00
|
|
|
|
|
|
|
|
|
/section>
|