The program works fine, but the code should consist of procedures.

program massiv; uses crt; var a,b,c:array [1..10, 1..10] of integer; n,m,i,j,k,x:integer; f1:text; begin Clrscr; Assign (f1, '1.txt'); reset(f1); n:=10; m:=6; writeln('исходная матрица ' ); for i:= 1 to n do begin for j:= 1 to m do begin read (f1, a[i,j]); write(a[i,j]:4); end; writeln; end; close(f1); readln; m:=m-1; writeln('удалили последний столбец '); for i:=1 to n do begin for j:= 1 to m do write(a[i,j]:4); writeln; end; readln; for i:=1 to m do for j:=1 to n do b[i,j]:=a[j,i]; writeln('транспонированная матрица '); for i:=1 to m do begin for j:=1 to n do write (b[i,j]:4); writeln; end; readln; for k:=1 to 5 do for j:=1 to 6 do begin c[k,j]:=0; for i:=1 to 10 do begin c[k,j]:=c[k,j]+b[k,i]*a[i,j]; end; end; writeln('Умножение матрицы А на матрицу At:'); for i:=1 to 5 do begin for j:=1 to 6 do write(c[i,j]:7); writeln; end; readln; x:=6; writeln('Матрица для обратной '); for i:=1 to 5 do begin for j:=1 to 5 do write (c[i,j]:7); writeln; end; readln; end. 

Closed due to the fact that the essence of the issue is incomprehensible by the participants of Kromster , pavel , user194374, Denis Bubnov , Bald December 29, '16 at 6:33 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Procedures are needed to improve the structure of programs and get rid of unnecessary copying. In your code, it is clear enough to reveal logical blocks:

    • creation and filling of the initial matrix
    • matrix transposition
    • matrix multiplication
    • ...

    Your task is to make part of this code in the procedure according to the rules of the language.