Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116512 | 唐安轩 | 矩阵加法 | C++ | Accepted | 5 MS | 384 KB | 497 | 2025-04-12 11:07:59 |
#include<bits/stdc++.h> using namespace std; int A[110][110]; int B[110][110]; int c[110][110]; int main(){ int n,m; 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; }