Problem Statement
Write a program to calculate the sum of the anti-diagonal elements (from top-right to bottom-left) of a square matrix.
DEMO-C-32 โข Programming in C
Write a program to calculate the sum of the anti-diagonal elements (from top-right to bottom-left) of a square matrix.
Input: Dimensions N M followed by the matrix elements.
Output: The formatted result as specified.
Submit runs every public testcase in this browser. Results and code never leave this device.
4 4 16 26 31 44 7 11 1 42 50 -8 49 17 -6 -6 -2 50
31
4 4 -4 24 5 26 24 38 20 47 -3 36 -2 2 14 -9 18 1
96
4 4 -3 47 37 6 -3 -3 50 28 -4 24 4 38 39 1 16 -5
119
5 5 49 27 1 11 15 20 17 36 18 30 30 -4 -10 -9 7 44 -10 30 14 25 38 47 2 27 26
51
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question