program SumMatrixCorners;
{$mode objfpc}{$H+}
type
TMatrix = array[1..3, 1..4] of Integer;
function SumCorners(const A: TMatrix): Integer;
begin
Result := A[1, 1] +
A[1, 4] +
A[3, 1] +
A[3, 4];
end;
var
M: TMatrix =
((1, 2, 3, 4),
(5, 6, 7, 8),
(9,10,11,12));
begin
Writeln('Sum of corners = ', SumCorners(M));
end.
{
run:
Sum of corners = 26
}