posted 20 years ago
Well, I don't know what the format of the input looks like, but there would be perhaps two nested for-loops, one over Y, one over Z, to read the input. Then to generate the output, again, two nested for-loops; one just steps over the columns, the other steps the length of each column, adding up the numbers; at the end of the outer loop, outside the inner loop, you'd assign the result to one element of the outside array.
Make sense?