Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
88771 sh25_chenyj 矩阵加法 C++ 通过 0 MS 248 KB 534 2026-05-15 15:39:56

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int n , m; cin>>n>>m; int ls1[n][m], ls2[n][m]; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cin>>ls1[i][j]; } } for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cin>>ls2[i][j]; } } int ls3[n][m]; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ ls3[i][j] = ls1[i][j]+ls2[i][j]; } } for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cout<<ls3[i][j]<<" "; } cout<<endl; } }


测评信息: