freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-163-cross-hatched-t...

56 lines
1.4 KiB
Markdown
Raw Normal View History

---
id: 5900f40f1000cf542c50ff22
challengeType: 5
videoUrl: ''
2020-10-01 15:54:21 +00:00
title: 问题163阴影线三角形
---
## Description
<section id="description">考虑等边三角形其中从每个顶点到相对侧的中间绘制直线例如在下面草图中的1号三角形中。 <p>现在可以在该三角形中观察到具有不同形状或大小或方向或位置的十六个三角形。使用大小为1的三角形作为构建块可以形成更大的三角形例如上面草图中的大小为2的三角形。现在可以在该尺寸2三角形中观察到具有不同形状或尺寸或方向或位置的一百四十个三角形。可以观察到2号三角形包含4个1号三角形构造块。大小为3的三角形将包含9个大小为1的三角形构建块因此大小为n的三角形将包含n2个大小为1的三角形构建块。如果我们将Tn表示为大小为n的三角形中存在的三角形的数量则T1= 16 T2= 104 Find T36</p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler163()</code>应返回343047。
testString: assert.strictEqual(euler163(), 343047);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler163() {
// Good luck!
return true;
}
euler163();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>