Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Identity-matrix/Delphi/identity-matrix.delphi
Normal file
25
Task/Identity-matrix/Delphi/identity-matrix.delphi
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
program IdentityMatrix;
|
||||
|
||||
// Modified from the Pascal version
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
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