The superdiagonal of a matrix
is formed by the elements
in the matrix for which the column is one position more than the row:
(see
https://en.wikipedia.org/wiki/Main_diagonal#superdiagonal);
that is, those elements lying along the diagonal just above the main
diagonal. Write a program that computes the sums of the superdiagonals
of several matrices.
Input is a sequence of cases. Each case starts with a nonnegative integer , followed by a square matrix of integers.
The sum of the superdiagonal elements of each matrix, in the same order, each in a line of its own.
Author: José Luis Balcázar
Generation: 2026-05-04T15:00:24.292Z
© Jutge.org, 2006–2026.
https://jutge.org