Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
51123 | littletwleve | 矩阵加法 | C++ | Accepted | 1 MS | 256 KB | 407 | 2024-09-20 10:15:17 |
#include<bits/stdc++.h> using namespace std; const int N=110; int a[N][N],b[N][N],m,n; int main(){ cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++) cin>>a[i][j]; } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++) cin>>b[i][j]; } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ a[i][j]+=b[i][j]; cout<<a[i][j]<<' '; } cout<<endl; } return 0; }