uses crt; const nn=10; mm=10; type matrix=array[1..nn, 1..mm] of integer; var a:matrix; i,j,k:integer; n,m:integer; s_max, s_min:integer; _min, _max:boolean; procedure readmatrix( var a: matrix; var n, m :integer); var i,j : integer; begin repeat write('Ievadi rindu skaitu: ');readln(n) until (n>0) and (n<=nn); repeat write('Ievadi kolonnu skaitu: ');readln(m) until (m>0) and (m<=mm); for i:=1 to n do begin for j:=1 to m do begin writeln('A[',i,j,']= '); readln(a[i,j]) end end end; procedure printmatrix(a :matrix; n,m: integer); var i,j,k: integer; begin for i:=1 to n do begin for j:=1 to m do write(a[i,j]:6); writeln; end end; Begin clrscr; readmatrix(a,n,m); printmatrix(a,n,m); for i:=1 to n do begin s_min:=1; s_max:=1; for j := 2 to m do if a[i, j]>a[i, s_max] then s_max:=j else if a[i, j]=a[i, s_max]); _max:=_max and (a[k, s_min]<=a[i, s_min]); end; if _max then writeln('Elements - ','a[',i,',',s_min,']=',a[i, s_min]) else if _min then writeln('Elements - ','a[',i,',',s_max,']=',a[i, s_max]); end; readkey end.