chore(i8n,learn): processed translations

This commit is contained in:
Crowdin Bot
2021-02-06 04:42:36 +00:00
committed by Mrugesh Mohapatra
parent 15047f2d90
commit e5c44a3ae5
3274 changed files with 172122 additions and 14164 deletions

View File

@ -1,48 +1,56 @@
---
id: 5a23c84252665b21eecc7eb1
title: 身份矩阵
title: Identity matrix
challengeType: 5
videoUrl: ''
forumTopicId: 302290
dashedName: identity-matrix
---
# --description--
*单位矩阵*是大小为\\n \\次n \\)的方阵,其中对角元素都是**1** s1所有其他元素都是**0** s。 \\ begin {bmatrix} 100 \\ cr 010 \\ cr 001 \\ cr \\ end {bmatrix}编写一个以数字'n'作为参数并返回单位矩阵的函数订单nx n。
An *identity matrix* is a square matrix of size \\( n \\times n \\), where the diagonal elements are all `1`s (ones), and all the other elements are all `0`s (zeroes).
<ul>
<li style='list-style: none;'>\(\displaystyle I_{n}=\begin{bmatrix} 1 &#x26; 0 &#x26; 0 \cr 0 &#x26; 1 &#x26; 0 \cr 0 &#x26; 0 &#x26; 1 \cr \end{bmatrix}\)</li>
</ul>
# --instructions--
Write a function that takes a number `n` as a parameter and returns the identity matrix of order \\( n \\times n \\).
# --hints--
`idMatrix`应该是一个功能。
`idMatrix` should be a function.
```js
assert(typeof idMatrix == 'function');
```
`idMatrix(1)`应该返回一个数组。
`idMatrix(1)` should return an array.
```js
assert(Array.isArray(idMatrix(1)));
```
`idMatrix(1)`应返回`"+JSON.stringify(results[0])+"`
`idMatrix(1)` should return `[ [ 1 ] ]`.
```js
assert.deepEqual(idMatrix(1), results[0]);
```
`idMatrix(2)`应返回`"+JSON.stringify(results[1])+"`
`idMatrix(2)` should return `[ [ 1, 0 ], [ 0, 1 ] ]`.
```js
assert.deepEqual(idMatrix(2), results[1]);
```
`idMatrix(3)`应返回`"+JSON.stringify(results[2])+"`
`idMatrix(3)` should return `[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]`.
```js
assert.deepEqual(idMatrix(3), results[2]);
```
`idMatrix(4)`应返回`"+JSON.stringify(results[3])+"`
`idMatrix(4)` should return `[ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]`.
```js
assert.deepEqual(idMatrix(4), results[3]);