/*
Set A and B to the bottom triangle matrix, and each of them is n rows and n columns. There is also a two-dimensional array C, which has n rows and n + 1 columns.
Design A scheme to store the lower Triangle Area elements in two matrices A and B in the same C.
You must store the elements in the lower Triangle Area of A in the lower Triangle Area of C, and the elements in the lower Triangle Area of B are transposed and stored in the upper triangle area of C.
The formula for calculating the storage location of matrix elements aij and B in A is given.
*/
# Include <iostream>
Using namespace std;
Int main ()
{
Int a [4] [4] = {1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10 }};
Int B [4] [4] = {11}, {12, 13}, {14, 15, 16}, {14, 15, 16, 17 }};
Int c [4] [5];
For (int I = 0; I <4; I ++)
{
Int j;
For (j = 0; j <= I; j ++)
{
C [I] [j] = a [I] [j];
}
For (j = I + 1; j <= 4; j ++)
{
C [I] [j] = B [j-1] [I];
}
}
For (int m = 0; m <4; m ++)
{
For (int n = 0; n <5; n ++)
{
Cout <c [m] [n] <"\ t ";
}
Cout <endl;
}
Return 0;
}