发布时间:2019-09-06 08:57:53编辑:auto阅读(2368)
这题目很难理解=,=、
- #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各
50097
49352
40012
37059
31446
28283
27238
22032
21990
20326
505°
366°
346°
537°
507°
1107°
2092°
1934°
1521°
3109°