Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet.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.6 KiB
Raw Blame History

id, challengeType, title, videoUrl, localeTitle
id challengeType title videoUrl localeTitle
5900f3761000cf542c50fe88 5 Problem 9: Special Pythagorean triplet 问题9特殊的毕达哥拉斯三重奏

Description

毕达哥拉斯三元组是一组三个自然数, a < b < c ,其中,
a 2 + b 2 = c 2
例如3 2 + 4 2 = 9 + 16 = 25 = 5 2 。恰好存在一个毕达哥拉斯三元组,其中a + b + c = 1000.求产品abc使得a + b + c = n

Instructions

Tests

tests:
  - text: <code>specialPythagoreanTriplet(1000)</code>应返回31875000。
    testString: assert.strictEqual(specialPythagoreanTriplet(1000), 31875000);
  - text: <code>specialPythagoreanTriplet(24)</code>应该返回480。
    testString: assert.strictEqual(specialPythagoreanTriplet(24), 480);
  - text: <code>specialPythagoreanTriplet(120)</code>应该返回49920。
    testString: assert([49920, 55080, 60000].includes(specialPythagoreanTriplet(120)));

Challenge Seed

function specialPythagoreanTriplet(n) {
 let sumOfabc = n;
 // Good luck!
 return true;
}

specialPythagoreanTriplet(1000);

Solution

// solution required

/section>