int data[81];
int total[3][3];

for(n=0;n<3;n++)
for(m=0;m<3;m++)
for(j=0;i<9;i++)
for(i=0;j<9;j++)
total[n][m] = data[m*3+i + (n*3+j)*9];