Program Matriz; Var M: array [1..5,1..5] of integer; SomaA, SomaB, SomaC, SomaD, SomaE: integer; i,j: integer; Begin clrscr; {Entrada de Dados} writeln('Digite o s 25 inteiros da matriz, por linhas, cada inteiro separado por ENTER'); For i:=1 to 5 do Begin For j:=1 to 5 do Begin Readln (M[i][j]); End; End; {Escrever a matriz entrada} writeln('Matriz: '); For i:= 1 to 5 do Begin writeln; For j:= 1 to 5 do Begin write(M[i][j]:6); end; writeln; end; {alínea A} SomaA:=0; For j:=1 to 5 do Begin SomaA:=SomaA+M[4][j]; end; writeln; writeln('A soma dos números da linha 4 da Matriz é ', SomaA); {alínea B} SomaB:=0; for i:=1 to 5 do begin SomaB:=SomaB+M[i][2]; end; writeln; writeln('A soma dos números da coluna 2 da Matriz é ', SomaB); {alínea C} SomaC:=0; For i:=1 to 5 do begin for j:=1 to 5 do if i=j then SomaC:=SomaC+M[i][j]; end; writeln; writeln('A soma dos números da diagonal principal da Matriz é ', SomaC); {alínea D} SomaD:=0; For i:=1 to 5 do begin for j:=1 to 5 do if i+j=6 then SomaD:=SomaD+M[i][j]; end; writeln; writeln('A soma dos números da diagonal secundária da Matriz é ', SomaD); {alínea E} SomaE:=0; For i:=1 to 5 do begin for j:=1 to 5 do SomaE:=SomaE+M[i][j]; end; writeln; writeln('A soma de todos os elementos da matriz é da Matriz é ', SomaE); End.