В паскале
const
n = 3;
k = 3;
var
i,j:integer;
a:array[1..n,1..k] of integer;
begin
for i:=1 to n do
for j:=1 to k do
begin
Writeln('Введите a[',i,',',j,']:');
readln(a[i,j]);
end;
writeln('Исходный массив:');
for i:=1 to n do
begin
for j:=1 to k do
write('a[':4,i,',',j,']=',a[i,j]);
writeln;
end;
for i:=1 to n do
for j:=1 to k do
if i=j then a[i,j]:=0;
writeln('Полученный массив:');
for i:=1 to n do
begin for j:=1 to k do
write('a[':4,i,',',j,']=',a[i,j]);
writeln;
end;
end.