uses crt; const n=4; m=5; type TElem=integer; TMx=array[1..n,1..m] of TElem; var Mx:TMx; p,q:integer; {vernet true esli stroki p i q matrici mx poxoji} function CompareRows(const p,q:integer; const mx:TMx):boolean; var i,j:integer; begin i:=1; while (i<=m) do begin j:=1; while (j<=m) and not (mx[p,i]=mx[q,i]) do inc(j); if (j<=m) then inc(i) else i:=m+2; end; CompareRows:=(i=m+1); end; {postro4nii vvod matrici } Procedure ReadMatr(var A:TMx; var n1,m1:word); var i,j:word; begin REPEAT write('vvedite koli4estvo strok: '); readln(n1); until(n1>0) and (n1<=n); repeat write('vvedite koli4estvo stolbcov: '); readln(m1); until (m1>0) and (m1<=m); for i:=1 to n1 do for j:=1 to m1 do a[i,j]:=random(5); end; {postro4nii vivod matrici} Procedure PrintMatr(a:TMx; n1,m1:word); var i,j:word; begin for i:=1 to n1 do begin for j:=1 to m1 do write(A[i,j],' '); writeln; end; end; var nn,mm:word; a:TMx; begin clrscr; randomize; Readmatr(a,nn,mm); Printmatr(a,nn,mm); for p:=1 to n-1 do for q:=p+1 to n do if CompareRows(p,q,Mx) then writeln(p, ':', q); readkey; end.