1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
int array[4][12] = {
{1,0,0,0,0,0,0,0,0,0,0,0},
{1,0,0,1,0,0,0,0,0,0,0,0},
{1,0,0,0,0,0,0,0,1,0,0,0},
{1,0,0,0,0,0,1,0,0,0,0,0}};
int main()
{
Calculate();
Sort();
}
void Calculate()
{
for(i = 0; i < 4; i++)
{
for(j = 0; j < 12; j++)
{
result[i] = Solve(array[i][j]);
}
}
void Sort()
{
//Here I sort the values of result and based on this, I also sort the arrays (that is, I exchange the arrays with each other)
}
int Solve(int x[])
{
//This function returns an int value by using the array x which has 1 dimension but actually this array is 2D as I defined at the beginning (array[4][12]).
}
|