Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
51123 littletwleve 矩阵加法 C++ 通过 1 MS 256 KB 407 2024-09-20 10:15:17

Tests(1/1):


#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; }


测评信息: