Home > database >  Who can teach me, the problem is how to do, just contact with C language, a dork
Who can teach me, the problem is how to do, just contact with C language, a dork

Time:10-02

Programming read five rows 4 column matrix in the first four lines 3 columns integer (the following diagram, data variable), then the sum of all, the sum of the columns and the sum of all Numbers out, and corresponding to fill in the last column in the table, place the last line and the bottom right hand corner of the matrix and the output,
7 8 9
4 5 6
1 2 3
9 8 7

The input description
In line 12 digits in order of priority, in turn, input matrix, each row enter an integer,

Output description
In the form of a square matrix output the whole matrix of the data, format control for: printf (" % 4 d ", a [I] [j]);

CodePudding user response:

reference 1st floor weixin_43046722 response:
q, side pass by

You wait a moment, I send the code to you

CodePudding user response:

refer to the original poster Pcy___ response:
programming read five rows 4 column matrix in the first four lines 3 columns integer (the following diagram, data variable), then the sum of all, the sum of the columns and the sum of all Numbers out, and corresponding to fill in the last column in the table, place the last line and the bottom right hand corner of the matrix and the output,
7 8 9
4 5 6
1 2 3
9 8 7

The input description
In line 12 digits in order of priority, in turn, input matrix, each row enter an integer,

Output description
In the form of a square matrix output the whole matrix of the data, format control for: printf (" % 4 d ", a [I] [j]);

#include
Int main ()
{
Int a [5] [4]={0};
Int I, j;
for(i=0; I<4. I++)
{
for(j=0; J<3; J++)
The scanf (" % d ", & amp; A [I] [j]);
}
for(i=0; I<4. I++)
{
for(j=0; J<4. J++)
{
If (i<4 & amp; & J<3)
{
A [I] [3]=[I] a [3] + [I] a [j];
}
A [4] [I]=[4] a [I] + [j] a [I];

}
}

for(i=0; I<5; I++)
{
for(j=0; J<4. J++)
Printf (" % 4 d ", a [I] [j]);
printf("\n");

}
return 0;
}
I am also they sent me
  • Related