Here is a example using matrix class CMatrix program and as a result, please design and complete the matrix class, tip: you can use a one-dimensional array to achieve
Int main ()
{
Int m=3, n=4;
CMatrix A (m, n);
int i, j;
for (i=0; I & lt; m ; I + +) {
For (j=0; J & lt; n; J + +)
A.E lementAt (I, j)=I * n + j + 1;
}
A. d. isplay ();
CMatrix B=A.R otate ();//rotate
B.D isplay ();
return 0;
}
Results:
1 2 3 4
5 6 7 8
9 10 11 12 1 5 9
2 June 10
3, 7, 11