| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 161739 | 张蔚林 | 矩阵乘法 | C++ | Accepted | 6 MS | 388 KB | 541 | 2026-10-07 10:14:16 |
#include<bits/stdc++.h> using namespace std; int main() { int a[100][100]={},b[100][100]={},c[100][100]={},n,m,k,t=0; cin>>n>>m>>k; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>a[i][j]; } } for(int i=0;i<m;i++){ for(int j=0;j<k;j++){ cin>>b[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<k;j++){ t=0; for(int l=0;l<m;l++){ t+=a[i][l]*b[l][j]; } c[i][j]=t; } } for(int i=0;i<n;i++){ for(int j=0;j<k;j++){ cout<<c[i][j]<<' '; } cout<<endl; } return 0; }