Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3698 孙浚轩 矩阵乘法 C++ Compile Error 0 MS 0 KB 491 2024-06-22 23:49:06

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int N,M,K; cin>>N>>M>>K; int A[N][M],B[M][K],C[N][K]; memset(C,0,sizeof(C)); 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++) for(int k=0;k<M;k++) C[i][j]+=A[i][k]*B[k][j]; for(int i=0;i<N;i++){ for(int j=0;j<K;j++) cout<<C[i][j]<<" "; cout<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:25: error: 'memset' was not declared in this scope
     memset(C,0,sizeof(C));
                         ^