multiply.cpp

来自「VC++ 写的一个矩阵计算器程序」· C++ 代码 · 共 26 行

CPP
26
字号
void multiply(double*p1,double*p2,double*pmatrix,int n)
{
	    double t;
		//pmatrix=new double[n*n];
		for(int e=0;e<n;e++)
		{
			for(int f=0;f<n;f++)
			{
                t=0;
				for(int g=0;g<n;g++)
					t+=p1[e*n+g]*p2[g*n+f];
					pmatrix[e*n+f]=t;
			}
		}
		/*for(int h=0;h<n;h++)
		{
		    for(int w=0;w<n;w++)
			{
			    cout.precision(6); 
                cout.setf(ios::scientific,ios::floatfield); 
                cout<<pmatrix[h*n+w]<<" ";
			}
			cout<<endl;
		}
		delete[n*n] pmatrix;*/ 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?