发布时间:2019-09-06 08:57:53编辑:auto阅读(2399)
这题目很难理解=,=、
- #include<iostream>
- #include<string>
- using namespace std;
- int main()
- {
- int a[3][3],b[3][3];
- int i,j,k,(*p)[3],(*p2)[3];
- p=a;
- p2=b;
- for(j=0;j<3;j++)
- for(k=0;k<3;k++)
- cin>>*(*(p+j)+k);
- cout<<"原始矩阵:"<<endl;
- for(j=0;j<3;j++)
- { for(k=0;k<3;k++)
- cout<<*(*(p+j)+k)<<" ";
- cout<<endl;
- }
- cout<<endl;
- cout<<"转置矩阵:"<<endl;
- p=a;
- p2=b;
- for(j=0;j<3;j++)
- {
- for(k=0;k<3;k++)
- {
- *(*(p2+k)+j)=*(*(p+j)+k);
- }
- }
- p2=a;
- for(j=0;j<3;j++)
- {
- cout<<endl;
- for(k=0;k<3;k++)
- cout<<b[j][k]<<" ";
- }
- }
上一篇: python Tkinter按钮带参数
下一篇: cocos2dx[3.x]——V3.x各
50492
49793
40388
37410
31831
28691
27622
22407
22407
20720
477°
1093°
894°
831°
1076°
952°
1565°
2925°
2606°
2006°