Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
139409 | 凌嘉圻 | 矩阵加法 | C++ | 通过 | 100 | 0 MS | 264 KB | 454 | 2024-03-23 17:23:29 |
#include<bits/stdc++.h> using namespace std; int n,m; int a[100][100],b[100][100],c[100][100]; 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++) c[i][j]=a[i][j]+b[i][j]; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<c[i][j]<<" ";} cout<<endl;} return 0; }