Let be a square matrix . This matrix has different frames. Frame is formed by rows and and columns and . Frame is formed by rows and and columns and , excluding the parts that are part of frame , etc.
In the following example, you have that the frame is formed by all the positions where there is a , the frame the positions where there is a , and the frame the positions where there is a :
0 0 0 0 0
0 1 1 1 0
0 1 2 1 0
0 1 1 1 0
0 0 0 0 0
You must implement the function
int sumaMarc(const Matriu& m, int x); with the
following specification:
PRE:
a matrix
and
.
POST: Returns the sum of the elements
of the frame
of
.
You only need to send the function we ask for and the functions you define. The rest will be ignored.
A matrix and .
The sum of the elements of the frame of .
Author: PRO1
Generation: 2026-01-25T12:53:55.825Z
© Jutge.org, 2006–2026.
https://jutge.org