C代码
#include<stdio.h>
#include<stdlib.h>
//二维数组转一维
/*以列为主的二维阵列要转为一维阵列时,是将二维阵列由上往下一列一列读入一维阵列,此时
索引的对应公式如下所示,其中row与column是二维阵列索引,loc表示对应的一维阵列索引:
loc = column + row*行数*/
int main1()
{
int num[3][3] = { {
1,2,3},{
4,5,6},{
7,8,9} };
printf("原二维数组:\n");
for (int i = 0; i < 3; i++)
{
for (