Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109237 | 邹昊辰 | 矩阵加法 | C++ | Accepted | 4 MS | 344 KB | 610 | 2025-02-07 11:29:00 |
#include <bits/stdc++.h> using namespace std; int main() { /**int a[3][3]; //行 for(int i=0;i<3;i++){ for(int j=0;j<3;j++){//行-下标为0开始(0,1,2) cin>>a[i][j]; } for(int l=0;l<=3;l++){ for(int x=0;x<3;x++){ cout<<a[i][j]; } } } }**/ int a[100][100],b[100][100]; int n,m; cin>>n>>m; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>a[i][j]; } } for(int x=0;x<n;x++){ for(int z=0;z<m;z++){ cin>>b[x][z]; } } for(int k=0;k<n;k++){ for(int l=0;l<m;l++){ cout<<b[k][l]+a[k][l]<<" "; } cout<<endl; } return 0; }