Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You have a two-dimensional array NxN, you need to get a one-dimensional array of length N. Each element of the one-dimensional array (to be obtained) is equal to the sum of some elements of the corresponding (by number, i.e. the 0th element of the array will be obtained from the elements of the 0th row of the matrix ) rows from the matrix. The sums can be of two types:
1) the element of the line that lies on the main diagonal < 0, then you are looking for the sum of the elements of this line, starting from the 0th element to the first negative
2) the element of the line that lies on the main diagonal => 0, then you are looking for the sum of the elements of this line, starting from the first non-negative element and up to the end of the line,
well, write the code yourself. only help if there is already something
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question