PROGRAM LAB; VAR M,N,i,j,Amax,Imax,k,T :integer; A: array[1..10,1..10] of integer; B: array[1..10] of integer; Fin, Fout :text; LABEL Vvod_M, Vvod_N; BEGIN assign(Fout,'A:\result.res'); rewrite(Fout); assign(Fin,'A:\datf.txt'); reset(Fin); Vvod_M: writeln('Vvedite chislo strok massiva'); readln(M); if (M<2) or (M>10) then begin writeln('Nedopustimoe znachenie'); goto Vvod_M; end; Vvod_N: writeln('Vvedite chislo stolbcov massiva'); readln(N); if (N<2) or (N>10) then begin writeln('Nedopustimoe znachenie'); goto Vvod_N; end; for i:=1 to M do for j:=1 to N do read(Fin,A[i,j]); close(Fin); writeln(Fout,'Ishodniy massiv iz ',M,'x',N,' elementov'); for i:=1 to M do begin for j:=1 to N do write(Fout,A[i,j]:2); writeln(Fout); end; writeln(Fout); Amax:=A[1,1]; Imax:=1; for i:=1 to M do for j:=1 to N do if A[i,j]>Amax then begin Amax:=A[i,j]; Imax:=i; end; begin B[i]:=A[Imax,j]; for i:=1 to M do for j:=M downto i+1 do if B[i] < B[i+1] then begin T:=B[i]; B[i]:=B[i+1]; B[i+1]:=T end end; writeln(Fout,'Rezultaty raboty':30); writeln(Fout); writeln(Fout,'Maximalniy element nahoditsya v ',Imax,' stroke'); writeln(Fout,'Sortirovanniy massiv':30); for i:=1 to M do write(Fout,B[i]:2); writeln(Fout); close(Fout); END.