Sum of elements below main diagonal of matrix: Difference between revisions
Sum of elements below main diagonal of matrix (view source)
Revision as of 23:27, 23 July 2021
, 2 years ago→{{header|C++}}: Fix condition
m (→{{header|C++}}: Fix condition) |
|||
Line 101:
T sum = 0;
for (std::size_t y = 0; y < matrix.size(); y++)
for (std::size_t x = 0; x <
sum += matrix[y][x];
return sum;
|