Run ID:27948

提交时间:2022-06-12 17:35:01

#include<iostream> #include<cmath> using namespace std; int main(){ int temp=0,a[101][101],b[101][101],c[101][101]={0},n,m,k; 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++){ temp=0; for(int z=0;z<m;z++){ temp+=a[i][z]*b[z][j]; } c[i][j]=temp; } } for(int i=0;i<n;i++){ for(int j=0;j<k;j++){ cout<<c[i][j]<<' '; } cout<<endl; } return 0; }