Mo Zargham 437ba8b103 fix(curriculum): Read-search-ask link now point to correct url as noted in the issue (#37753)
* fix: broken Read-search-ask link now point to correct url

* fix: changed link to original forum link with more views

* fix: changed http links to correct version

* fix: link in help modal
2019-11-19 19:54:48 -05:00

1.5 KiB
Raw Blame History

id, title, isRequired, challengeType, videoUrl, localeTitle
id title isRequired challengeType videoUrl localeTitle
a3bfc1673c0526e06d3ac698 Sum All Primes true 5 Sum All Primes

Description

将所有素数加起来并包括所提供的数字。素数被定义为大于1的数并且只有两个除数一个和一个除数。例如2是素数因为它只能被1和2整除。提供的号码可能不是主要的。如果卡住请记得使用Read-Search-Ask 。尝试配对程序。编写自己的代码。

Instructions

Tests

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.");'

Challenge Seed

function sumPrimes(num) {
  return num;
}

sumPrimes(10);

Solution

// solution required