Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-20-factorial-digit-sum.chinese.md
Oliver Eyton-Williams 61460c8601 fix: insert blank line after ```
search and replace ```\n< with ```\n\n< to ensure there's an empty line
before closing tags
2020-08-16 04:45:20 +05:30

1.4 KiB
Raw Blame History

id, challengeType, title, videoUrl, localeTitle
id challengeType title videoUrl localeTitle
5900f3801000cf542c50fe93 5 Problem 20: Factorial digit sum 问题20因子数字和

Description

n !意味着n × n - 1×...×3×2×1例如10 = 10×9×...×3×2×1 = 3628800
和数字10中的数字之和是3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.找到数字之和n

Instructions

Tests

tests:
  - text: <code>sumFactorialDigits(10)</code>应该返回27。
    testString: assert.strictEqual(sumFactorialDigits(10), 27);
  - text: <code>sumFactorialDigits(25)</code>应该返回72。
    testString: assert.strictEqual(sumFactorialDigits(25), 72);
  - text: <code>sumFactorialDigits(50)</code>应该返回216。
    testString: assert.strictEqual(sumFactorialDigits(50), 216);
  - text: <code>sumFactorialDigits(75)</code>应该返回432。
    testString: assert.strictEqual(sumFactorialDigits(75), 432);
  - text: <code>sumFactorialDigits(100)</code>应该返回648。
    testString: assert.strictEqual(sumFactorialDigits(100), 648);

Challenge Seed

function sumFactorialDigits(n) {
  // Good luck!
  return n;
}

sumFactorialDigits(100);

Solution

// solution required

/section>