const n=5;
var k,i,j,count:integer;
c:array[1..n,1..n] of integer;
begin
readln (k);
count:=0;
for i:=1 to n do
for j:=1 to n do
c[i,j]:=random(100);
write(c[i,j],' ')
end;
writeln;
if c[i,j]= c[k,k]
then
count:=count+1;
writeln(count:4);
end.
Объяснение:
const n=5;
var k,i,j,count:integer;
c:array[1..n,1..n] of integer;
begin
readln (k);
count:=0;
for i:=1 to n do
begin
for j:=1 to n do
begin
c[i,j]:=random(100);
write(c[i,j],' ')
end;
writeln;
end;
for i:=1 to n do
for j:=1 to n do
if c[i,j]= c[k,k]
then
count:=count+1;
writeln(count:4);
end.
Объяснение: