var
matrix : array [1..4, 1..4] of integer;
i,k,sr,st:Integer;
begin
sr := 1;
st := 4;
for i:=1 to 4 do
for k:=1 to 4 do
if (sr = i) and (st = k) then begin
matrix[i,k]:= 1;
sr := sr + 1;
st := st - 1;
end
else matrix[i,k]:= 0;
write(' ', matrix[i,k]);
writeln
end;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
matrix : array [1..4, 1..4] of integer;
i,k,sr,st:Integer;
begin
sr := 1;
st := 4;
for i:=1 to 4 do
for k:=1 to 4 do
if (sr = i) and (st = k) then begin
matrix[i,k]:= 1;
sr := sr + 1;
st := st - 1;
end
else matrix[i,k]:= 0;
for i:=1 to 4 do
begin
for k:=1 to 4 do
write(' ', matrix[i,k]);
writeln
end;