Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.chinese.md
Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

2.5 KiB
Raw Blame History

title, id, challengeType, videoUrl, localeTitle
title id challengeType videoUrl localeTitle
Averages-Pythagorean means 594d966a1467eb84194f0086 5 平均值 - 毕达哥拉斯指的是

Description

计算整数1到10 (包括)的所有三个毕达哥拉斯方法

为这组正整数显示$ Ax_1\ ldotsx_n\ geq Gx_1\ ldotsx_n\ geq Hx_1\ ldotsx_n$ 。

这三种方法中最常见的算术平均值是列表的总和除以其长度: $ Ax_1\ ldotsx_n= \ frac {x_1 + \ cdots + x_n} {n} $ 几何mean是列表产品的$ n $ th根 $ Gx_1\ ldotsx_n= \ sqrt [n] {x_1 \ cdots x_n} $ 调和平均值是$ n $除以总和列表中每个项目的倒数: $ Hx_1\ ldotsx_n= \ frac {n} {\ frac {1} {x_1} + \ cdots + \ frac {1} {x_n}} $

假设输入是包含所有数字的有序数组。

要获得答案,请按以下格式输出对象:

 {
  值:{
    算术5.5
    几何4.528728688116765
    谐波3.414171521474055
  }
  测试:'是A> = G> = H是'
}

Instructions

Tests

tests:
  - text: <code>pythagoreanMeans</code>是一种功能。
    testString: assert(typeof pythagoreanMeans === 'function');
  - text: '<code>pythagoreanMeans([1, 2, ..., 10])</code>应该等于上面相同的输出。'
    testString: assert.deepEqual(pythagoreanMeans(range1), answer1);

Challenge Seed

function pythagoreanMeans (rangeArr) {
  // Good luck!
}

After Test

console.info('after the test');

Solution

// solution required