Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-16-power-digit-sum.md

34 lines
603 B
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: 5900f37d1000cf542c50fe8f
title: 问题16电源数字总和
challengeType: 5
videoUrl: ''
---
# --description--
2 <sup>15<!-- sup-->= 32768其位数之和为3 + 2 + 7 + 6 + 8 = 26。 2 <sup><code>指数<!-- code--><!-- sup-->的数字总和是多少?</code></sup></sup>
# --hints--
`powerDigitSum(15)`应该返回26。
```js
assert.strictEqual(powerDigitSum(15), 26);
```
`powerDigitSum(128)`应该返回166。
```js
assert.strictEqual(powerDigitSum(128), 166);
```
`powerDigitSum(1000)`应返回1366。
```js
assert.strictEqual(powerDigitSum(1000), 1366);
```
# --solutions--