一只题解
2025-07-25 16:41:33
发布于:上海
1阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
int a[10]{};
int b[10]{};
int q[10][10];
int hq,hh;
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
cin>>q[i][j];
}
}
cin>>hq>>hh;
for(int j=0;j<5;j++){
a[j]=q[hq-1][j];
}
for(int j=0;j<5;j++){
b[j]=q[hh-1][j];
}
for(int j=0;j<5;j++){
q[hh-1][j]=a[j];
}
for(int j=0;j<5;j++){
q[hq-1][j]=b[j];
}
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
cout<<q[i][j]<<" ";
}
cout<<endl;
}
}
这里空空如也
有帮助,赞一个