/********************************************************
** Highlight software by yzfy(雨中飞燕) http:// *
*********************************************************/
#include<stdio.h>
int map_a[36]={ 1, 2, 6, 7,15,16,
3, 5, 8,14,17,26,
4, 9,13,18,25,27,
10,12,19,24,28,33,
11,20,23,29,32,34,
21,22,30,31,35,36
};
int map_b[36];
void Init()
{
int n;
for (n=0; n<36; ++n)
{
map_b[map_a[n]-1] = n;
}
}
void OutPut(int array[6][6])
{
int* p = (int*)array;
int n;
for (n=0; n<36; ++n)
{
printf("%3d", p[map_b[n]]);
if (n%6==5)putchar('\n');
}
}
int main()
{
int a[6][6]=
{
{11,12,13,14,15,16},
{21,22,23,24,25,26},
{31,32,33,34,35,36},
{41,42,43,44,45,46},
{51,52,53,54,55,56},
{61,62,63,64,65,66}
};
Init();
OutPut(a);
getchar();
return 0;
}
我认为楼主是这个意思,给你一任意6*6数组,按指定顺序输出
" border="0" />[color=white]