freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-155-counting-capaci...

45 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4081000cf542c50ff1a
title: 问题155计算电容器电路
challengeType: 5
videoUrl: ''
dashedName: problem-155-counting-capacitor-circuits
---
# --description--
电路仅使用相同值C的相同电容器。
电容器可以串联或并联连接以形成子单元子单元然后可以与其他电容器或其他子单元串联或并联连接以形成更大的子单元以此类推直到最终电路。使用这个简单的程序和多达n个相同的电容器我们可以制造具有一系列不同总电容的电路。例如使用最多n = 3个电容器每个电容器为60 F我们可以获得以下7个不同的总电容值
如果我们用Dn表示当使用多达n个等值电容器时我们可以获得的不同总电容值的数量和上述简单程序我们得到D1= 1D2= 3 D3= 7 ...求D18。提醒当并联电容器C1C2等时总电容为CT = C1 + C2 + ......
而当它们串联连接时,总电容由下式给出:
# --hints--
`euler155()`应返回3857447。
```js
assert.strictEqual(euler155(), 3857447);
```
# --seed--
## --seed-contents--
```js
function euler155() {
return true;
}
euler155();
```
# --solutions--
```js
// solution required
```