30
构造身份矩阵
挑战非常简单。给定整数输入n,输出n x n单位矩阵。单位矩阵是1从左上角到右下角的s 矩阵。您将编写一个程序或函数来返回或输出您构造的身份矩阵。您的输出可能是2D数组,或者是由空格/制表符和换行符分隔的数字。 输入和输出示例 1: [[1]] 2: [[1, 0], [0, 1]] 3: [[1, 0, 0], [0, 1, 0], [0, 0, 1]] 4: [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] 5: [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], …
43
code-golf
math
matrix
linear-algebra
binary-matrix
code-challenge
polyglot
code-golf
restricted-source
programming-puzzle
expression-building
apl
code-challenge
image-processing
compression
code-golf
puzzle-solver
code-golf
grid
code-golf
number
number-theory
code-golf
array-manipulation
sorting
code-golf
string
balanced-string
code-golf
puzzle-solver
code-golf
string
decision-problem
code-golf
path-finding
puzzle-solver
graph-theory
code-golf
string
encode
networking
code-golf
code-golf
string
chemistry
code-golf
date
code-golf
decision-problem
graph-theory
code-golf
ascii-art
graph-theory
code-golf
string