// PascalABC.NET 3.3
begin
var a:=MatrRandom(7,7,-10,10);
writeln('A:'); a.Println(5);
var s:=a.ElementsWithIndexes.Where(k->(k[1]=k[2])and(k[0].IsEven)).
Select(k->k[0]).Sum;
writeln('s = ',s);
end.
Пример:
A:
5 3 -8 3 -2 -9 -5
-4 5 -7 9 -1 -9 3
-6 -5 10 -6 3 2 -8
-6 10 -10 -2 7 7 2
-7 1 4 -6 10 -6 -6
-9 -2 -3 6 6 -7 8
-8 10 9 -10 2 10 -3
s = 18