60 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			60 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
|   | --- | |||
|  | id: a3bfc1673c0526e06d3ac698 | |||
|  | title: Sum All Primes | |||
|  | isRequired: true | |||
|  | challengeType: 5 | |||
|  | videoUrl: '' | |||
|  | localeTitle: Sum All Primes | |||
|  | --- | |||
|  | 
 | |||
|  | ## Description
 | |||
|  | <section id="description">将所有素数加起来并包括所提供的数字。素数被定义为大于1的数,并且只有两个除数,一个和一个除数。例如,2是素数,因为它只能被1和2整除。提供的号码可能不是主要的。如果卡住,请记得使用<a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section> | |||
|  | 
 | |||
|  | ## Instructions
 | |||
|  | <section id="instructions"> | |||
|  | </section> | |||
|  | 
 | |||
|  | ## Tests
 | |||
|  | <section id='tests'> | |||
|  | 
 | |||
|  | ```yml | |||
|  | tests: | |||
|  |   - text: <code>sumPrimes(10)</code>应该返回一个数字。 | |||
|  |     testString: 'assert.deepEqual(typeof sumPrimes(10), "number", "<code>sumPrimes(10)</code> should return a number.");' | |||
|  |   - text: <code>sumPrimes(10)</code>应该返回17。 | |||
|  |     testString: 'assert.deepEqual(sumPrimes(10), 17, "<code>sumPrimes(10)</code> should return 17.");' | |||
|  |   - text: <code>sumPrimes(977)</code>应该返回73156。 | |||
|  |     testString: 'assert.deepEqual(sumPrimes(977), 73156, "<code>sumPrimes(977)</code> should return 73156.");' | |||
|  | 
 | |||
|  | ``` | |||
|  | 
 | |||
|  | </section> | |||
|  | 
 | |||
|  | ## Challenge Seed
 | |||
|  | <section id='challengeSeed'> | |||
|  | 
 | |||
|  | <div id='js-seed'> | |||
|  | 
 | |||
|  | ```js | |||
|  | function sumPrimes(num) { | |||
|  |   return num; | |||
|  | } | |||
|  | 
 | |||
|  | sumPrimes(10); | |||
|  | 
 | |||
|  | ``` | |||
|  | 
 | |||
|  | </div> | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | </section> | |||
|  | 
 | |||
|  | ## Solution
 | |||
|  | <section id='solution'> | |||
|  | 
 | |||
|  | ```js | |||
|  | // solution required | |||
|  | ``` | |||
|  | </section> |