CodePudding user response:
# include
# define m 2
# define n 3
Int main ()
{
int i,j;
Int a [m] [n], [n] [m]. B
Printf (" please input array data \ n ");
for(i=0; i{
for(j=0; j{
The scanf (" % d ", & amp; A [I] [j]);
B [j] [I]=[I] [j];
}
}
for(j=0; j{
for(i=0; i{
Printf (" % d, b [j] [I]);
}
printf("\n");
}
return 0;
}
CodePudding user response:
# include "stdafx. H"#include
#include
#include
# define N 100
The class RectangleZhuan
{
Public:
RectangleZhuan ()
{
Cout<& lt;" You have entered the matrix transformation object, please input matrix order, shall not exceed 100: \ n ";
GetNum ();
GetsRecBass ();
}
~ RectangleZhuan ()
{
Cout<& lt;" Calling the destructor, matrix transformation exit!"
Void getNum ()
{
Int nw;
cin> Nw.
N=nw;
}
Void getsRecBass ()
{
Cout<& lt;" Please input information for matrix items: \ n ";
for(i=0; i
Cout<& lt;" You just input the information for: \ n ";
for(i=0; i
If (j + 1) % (n==0)
CoutThe else
Cout}
for(i=0; i
Int temp=a, [I] [j].
A [I] [j]=[j] a [I];
A [j] [I]=temp;
}
Cout<& lt;" After transposed matrix for: \ n ";
for(i=0; i
If (j + 1) % (n==0)
CoutThe else
Cout}
}
Private:
Int a [N] [N], I, j, N.
};
Void main ()
{
RectangleZhuan r;
} oriented to the code,