Var a:array[1..100,1..100] of integer;
i,j,flag,n,k:byte;
begin
randomize;
k:=0;
Writeln('vvedite n'); readln(n);
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(100)+1;
write(a[i,j],' ');
end;
Writeln;
end;
for i:=1 to n do
begin
flag:=0;
for j:=1 to n do
begin
if a[i,j]=a[i,j+1]
then flag:=1;
end;
if flag=1
then k:=k+1;
end;
Writeln(k);
readln;
end.
i,j,flag,n,k:byte;
begin
randomize;
k:=0;
Writeln('vvedite n'); readln(n);
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(100)+1;
write(a[i,j],' ');
end;
Writeln;
end;
for i:=1 to n do
begin
flag:=0;
for j:=1 to n do
begin
if a[i,j]=a[i,j+1]
then flag:=1;
end;
if flag=1
then k:=k+1;
end;
Writeln(k);
readln;
end.