Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77620 余慕涵 矩阵行交换 C++ Presentation Error 1 MS 272 KB 605 2024-06-14 20:06:15

Tests(0/2):


Code:

#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ int n,m,k=0,j=0,x=0,c=0; cin>>m>>n; int v[5][5]; int b[5]; for(k=0;k<5;k++){ for(j=0;j<5;j++) cin>>v[k][j];} for(x=0;x<5;x++) b[x]=v[n-1][x]; for(x=0;x<5;x++){ v[n-1][x]=v[m-1][x]; v[m-1][x]=b[x];} for(k=0;k<5;k++){ cout<<endl; for(j=0;j<5;j++) cout<<v[k][j]<<" "; } return 0; }