双重循环即可
int n=..,m=...,i,j;
double a[n][m]={...};
double b[m][n];
for (i=0;i
互换后的在b中。
原矩阵:
for i=1 to n
for j=1 to m
print a(i,j);
next j
next i
修改后:
for j=1 to m
for i=1 to n
print a(i,j);
next i
next j