Sum of both diagonals

Print the sum of the two diagonals of the matrix. If a cell lies on both diagonals (the center of an odd-sized matrix), count it only once.

Liseh Academy