发布时间:2019-09-06 08:57:53编辑:auto阅读(2281)
这题目很难理解=,=、
- #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各
48964
48096
38836
35963
30378
27166
26158
20994
20828
19182
11°
18°
38°
721°
792°
770°
772°
751°
697°
823°