4. Ask a integer of 4 * 4 matrix in addition to the main diagonal, diagonal, the last line, beyond the sum of all the elements of the last column (the connection to the main diagonal of matrix on the upper left corner to the lower right corner, vice diagonal to the upper right corner to the lower left corner of the matrix attachment)
Written in c language
CodePudding user response:
Fix:
# include & lt; Stdio. H>
Int main ()
{
Int a [4] [4]=,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 {1};
Int sum=0;
int i, j;
for(i=0; i<3; I++)
{
for(j=0; j<3; J++)
{
If (I.=j & amp; & I + j!
=3){
Sum=sum + a, [I] [j].
}
}
}
Printf (" % d \ n ", sum);
return 0;
}