发布时间:2019-09-06 08:57:53编辑:auto阅读(2267)
这题目很难理解=,=、
- #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各
48864
47930
38706
35857
30284
27036
26068
20901
20697
19065
498°
593°
603°
605°
584°
570°
633°
709°
827°
928°