In the following square matrix graph, the three numbers in each row, the three numbers in each column and the three numbers in diagonal are equal. How to do it with positive and negative numbers

In the following square matrix graph, the three numbers in each row, the three numbers in each column and the three numbers in diagonal are equal. How to do it with positive and negative numbers


1 6 -1
0 2 4
5 -2 3
1+2+3=6
5+2-1=6
1+0+5=6
6+2-2=6
-1+4+3=6
1+6-1=6
0+2+4=6
5-2+3=6



If you add the same number to each number in a square matrix, the sum of 3 numbers in each row, 3 numbers in each column, and 3 numbers in diagonal angles in the square matrix is still equal. In this way, a new square matrix is formed. According to the number given in the figure below, compared with the original square matrix, can you complete the following square matrix?
1 2 -3 ( ) ( )
-4 0 4 ( ) ( )
3 -2 -1 ( ) -7
Two columns


Are you two columns or three columns? Three columns means 7 1 - 8. Two columns means 8 - 8
15 0 -15 -15 15
8 -1 -7 7 -7



Three rows and three columns of square matrix, the middle is 0, fill in the blank space with 1-9. It is required that the sum of three numbers of each diagonal line in each row and column is equal


Nine palace formula
The meaning of the nine palaces is based on the spirit turtle, with 24 shoulders, 68 feet, three on the left and seven on the right
4 9 2
3 5 7
8 1 6



Find the sum of main diagonal and sub diagonal elements in each row and column of square matrix
I'm a beginner. Please don't be too complicated


a[100][100]
This is a 100 * 100 square matrix
for(int j=0;j