Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58447 | 王一涵(吃土豆长大的马铃薯) | 矩阵交换行 | C++ | Accepted | 0 MS | 248 KB | 376 | 2024-12-11 16:45:47 |
#include<iostream> using namespace std; int main() { int a[10][10],b[10],n,m; for(int i=1;i<=5;i++){ for(int j=1;j<=5;j++){ cin>>a[i][j]; } } cin>>n>>m; for(int col=1;col<=5;col++){ b[col]=a[n][col]; a[n][col]=a[m][col]; a[m][col]=b[col]; } for(int i=1;i<=5;i++){ for(int j=1;j<=5;j++){ cout<<a[i][j]<<" "; } cout<<endl; } }