社区讨论
哪错了
B2099矩阵交换行参与者 2已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @mil5nrpw
- 此快照首次捕获于
- 2025/11/30 11:23 3 个月前
- 此快照最后确认于
- 2025/12/02 17:10 3 个月前
CPP
#include<bits/stdc++.h>
#define rt return
using namespace std;
int a[5][5],m,n;
int main(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
cin>>a[i][j];
}
}
cin>>m>>n;
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
if(i==m-1){
cout<<a[n-1][j];
}
else if(i==n-1){
cout<<a[m-1][j];
}
else{
cout<<a[i][j];
}
}
cout<<endl;
}
return 0;
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...