#include #include #include #include #include using namespace std; #include int main(void) { int arr[3][3],z,mini=0; int sarr[9],add[8]; int i,j,k=0,sum=0; for(i=0;i<3;i++) { for(j=0;j<3;j++) { cin>>arr[i][j]; } } for(i=0;i<3;i++) { for(j=0;j<3;j++) { sarr[k] = arr[i][j]; k++; } } int matrix[8][9]={{4,9,2,3,5,7,8,1,6},{2,7,6,9,5,1,4,3,8},{6,1,8,7,5,3,2,9,4},{8,3,4,1,5,9,6,7,2},{2,9,4,7,5,3,6,1,8},{6,7,2,1,5,9,8,3,4},{8,1,6,3,5,7,4,9,2},{4,3,8,9,5,1,2,7,6}}; for (i=0;i<8;i++) { k=0; for(j=0;j<9;j++) { matrix[i][j] = matrix[i][j]-sarr[k]; if(matrix[i][j] <0) { matrix[i][j] = -1*matrix[i][j]; } k++; } } for (i = 0; i <8;++i) { sum=0; for (j = 0; j <9;++j) { sum = sum + matrix[i][j]; } add[i] = sum; } for(j=0;j<8;j++) { if(add[j]