根据下面类中成员函数 operator*的原型和注释写出它的类外定义
const int n=4;
class M
{
public:
M()
{
int i,j;//矩阵类
for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i][j]=0;
}
M operator*(M &rm); //两个矩阵的乘法运算
private:
int a[n][n];
};
M M::operator*(M &rm)
{
M ret;
for(i = 0; i < n; ++i)//矩阵相乘 this 的行数
{
for(j = 0; j < n; ++j) // rm 的列数
{
for(k = 0; k < n; ++k) // this 的列数
ret.a[i][j] += this->a[i][k] * rm.a[k][j];
}
}
return ret;
}