关于数组的行列颠倒问题
例如
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
。
。
57。。。。。。。。。64
转换为
1 。。。。。。。。。57
2 。
3 .
4 .
5 .
6 .
7 .
8...................64
[解决办法]
不就是矩阵的转置吗?
http://topic.csdn.net/u/20070327/08/08cda563-fdd4-4d80-9592-8228febbd7fb.html
这里老问题了。
[解决办法]
#include <stdlib.h>#include <stdio.h>#include <iostream>int main(){ int a[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; int b[16]; int i,j;
[解决办法]
就是[i,j]和[j,i]交换, 一维数组当二维数组你应该会用吧, [i,j]表示为arr[i*row_len+j].