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

603 B
Raw Blame History

id title challengeType videoUrl
5900f37d1000cf542c50fe8f 问题16电源数字总和 5

--description--

2 15= 32768其位数之和为3 + 2 + 7 + 6 + 8 = 26。 2 指数的数字总和是多少?

--hints--

powerDigitSum(15)应该返回26。

assert.strictEqual(powerDigitSum(15), 26);

powerDigitSum(128)应该返回166。

assert.strictEqual(powerDigitSum(128), 166);

powerDigitSum(1000)应返回1366。

assert.strictEqual(powerDigitSum(1000), 1366);

--solutions--