Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Identity-matrix/Pascal/identity-matrix.pas
Normal file
21
Task/Identity-matrix/Pascal/identity-matrix.pas
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
program IdentityMatrix(input, output);
|
||||
|
||||
var
|
||||
matrix: array of array of integer;
|
||||
n, i, j: integer;
|
||||
|
||||
begin
|
||||
write('Size of matrix: ');
|
||||
readln(n);
|
||||
setlength(matrix, n, n);
|
||||
|
||||
for i := 0 to n - 1 do
|
||||
matrix[i,i] := 1;
|
||||
|
||||
for i := 0 to n - 1 do
|
||||
begin
|
||||
for j := 0 to n - 1 do
|
||||
write (matrix[i,j], ' ');
|
||||
writeln;
|
||||
end;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue