Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
324870 钟宜辰 【C4-11】幻方矩阵 C++ 解答错误 10 5 MS 408 KB 528 2025-06-01 10:41:48

Tests(1/10):


#include<bits/stdc++.h> using namespace std; int a[250][250],n,m,op,x,y,z; int main(){ cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; } } cin>>op; for(int i=1;i<=op;i++){ cin>>x>>y>>z; if(x==0){ for(int j=1;j<=m;j++){ swap(a[y][j],a[z][j]); } } if(x==1){ for(int j=1;j<=m;j++){ swap(a[j][y],a[j][z]); } } } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<a[i][j]<<" "; } cout<<endl; } return 0; }


测评信息: