64 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | ||
| id: 5900f3801000cf542c50fe93
 | ||
| challengeType: 5
 | ||
| title: 'Problem 20: Factorial digit sum'
 | ||
| videoUrl: ''
 | ||
| localeTitle: 问题20:因子数字和
 | ||
| ---
 | ||
| 
 | ||
| ## Description
 | ||
| <section id="description"> <var>n</var> !意味着<var>n</var> ×( <var>n</var> -  1)×...×3×2×1例如,10! = 10×9×...×3×2×1 = 3628800, <br>和数字10中的数字之和!是3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.找到数字之和<var>n</var> ! </section>
 | ||
| 
 | ||
| ## Instructions
 | ||
| <section id="instructions">
 | ||
| </section>
 | ||
| 
 | ||
| ## Tests
 | ||
| <section id='tests'>
 | ||
| 
 | ||
| ```yml
 | ||
| tests:
 | ||
|   - text: <code>sumFactorialDigits(10)</code>应该返回27。
 | ||
|     testString: 'assert.strictEqual(sumFactorialDigits(10), 27, "<code>sumFactorialDigits(10)</code> should return 27.");'
 | ||
|   - text: <code>sumFactorialDigits(25)</code>应该返回72。
 | ||
|     testString: 'assert.strictEqual(sumFactorialDigits(25), 72, "<code>sumFactorialDigits(25)</code> should return 72.");'
 | ||
|   - text: <code>sumFactorialDigits(50)</code>应该返回216。
 | ||
|     testString: 'assert.strictEqual(sumFactorialDigits(50), 216, "<code>sumFactorialDigits(50)</code> should return 216.");'
 | ||
|   - text: <code>sumFactorialDigits(75)</code>应该返回432。
 | ||
|     testString: 'assert.strictEqual(sumFactorialDigits(75), 432, "<code>sumFactorialDigits(75)</code> should return 432.");'
 | ||
|   - text: <code>sumFactorialDigits(100)</code>应该返回648。
 | ||
|     testString: 'assert.strictEqual(sumFactorialDigits(100), 648, "<code>sumFactorialDigits(100)</code> should return 648.");'
 | ||
| 
 | ||
| ```
 | ||
| 
 | ||
| </section>
 | ||
| 
 | ||
| ## Challenge Seed
 | ||
| <section id='challengeSeed'>
 | ||
| 
 | ||
| <div id='js-seed'>
 | ||
| 
 | ||
| ```js
 | ||
| function sumFactorialDigits(n) {
 | ||
|   // Good luck!
 | ||
|   return n;
 | ||
| }
 | ||
| 
 | ||
| sumFactorialDigits(100);
 | ||
| 
 | ||
| ```
 | ||
| 
 | ||
| </div>
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| </section>
 | ||
| 
 | ||
| ## Solution
 | ||
| <section id='solution'>
 | ||
| 
 | ||
| ```js
 | ||
| // solution required
 | ||
| ```
 | ||
| </section>
 |