C++ Practice Problem – Sum of Elements on Both Diagonals of a Matrix
Time Limit: 2s Memory Limit: 192MB Problem DescriptionCalculate the sum of the elements on both diagonals of a matrixInput FormatNumber of rows N of the matrixand an N*N integer matrix a[N][N] (N<=10)Output FormatThe sum of the elements on both diagonals of the input matrixSample Input31 2 3 4 5 6 7 8 9Sample Output25Code #include … Read more