#include<iostream>
using namespace std;
int main()
{
int a[2][3]={{1,2,3},{4,5,6}};
int b[3][2],i,j;
cout<<"array a:"<<endl;
for (i=0;i<=1;i++)
{for(j=0;j<=2;j++)
{
cout<<a[i][j]<<" ";
b[j][i]=a[i][j];
}
cout<<endl;
}
cout<<"array b:"<<endl;
for(i=0;i<=2;i++)
{
for(i=0;j<=1;j++)
cout<<b[i][j]<<" ";
cout<<endl;
}
return 0;
}
PS:编译后提示
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/二维数组程序举例.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
3Q。