Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2852 邓小龙 矩阵加法 C++ Accepted 2 MS 336 KB 454 2024-03-08 12:03:11

Tests(10/10):


Code:

# include<iostream> using namespace std; int main(){ int a[101][101]={1}, result[101][101]={}, m, n, c; cin>>m>>n; for(int i = 0; i < m; i++)for(int j = 0; j < n; j++)cin>>a[i][j]; for(int i = 0; i < m; i++)for(int j = 0; j < n; j++){ cin>>c; result[i][j] = a[i][j]+c; } for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++)cout<<result[i][j]<<" "; cout<<endl; } return 0; }