Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
26052 Andrew宥杨 矩阵加法 C++ 通过 1 MS 248 KB 567 2023-08-30 13:38:00

Tests(1/1):


#include <iostream> using namespace std; int main(){ int a,b; cin>>a>>b; int num1[a][b],num2[a][b],num3[a][b]; for (int row=0;row<a;row++){ for (int col=0;col<a;col++){ cin>>num1[row][col]; } } for (int row=0;row<a;row++){ for (int col=0;col<a;col++){ cin>>num2[row][col]; } } for (int row=0;row<a;row++){ for (int col=0;col<a;col++){ num3[row][col]=num1[row][col]+num2[row][col]; } } for (int row=0;row<a;row++){ for (int col=0;col<a;col++){ cout<<num3[row][col]<<" "; } cout<<endl; } return 0; }


测评信息: