发布时间:2019-09-06 08:57:53编辑:auto阅读(2550)
这题目很难理解=,=、
- #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各
51729
51386
41820
38592
33071
30079
28750
23746
23656
22025
27°
2251°
2941°
2453°
2395°
2985°
2403°
3206°
5271°
5102°