//assuming x[row][column]

//s is squares, sr is square root, return value is diagonal elements

int calculate(int *x[10][10], int *s, int *sr) {

int i,j,k, sum=0;

*s=0; *sr=0;

for(i=0,j=9;i<10;i++ ,j--){

sum+=*x[i][i]+*x[i][j];

for(k=0;k<9;k++) if(i%2) *s+=*x[i][k]**x[i][k]; else *sr+=sqrt(*x[k][i]);

}

return(sum-=*x[4][4]);

}