C++ 编一个程序,考试中。
来源:百度知道 编辑:UC知道 时间:2024/05/31 07:16:01
#include<iostream>
using namespace std;
class matrix
{
private:
double *p;
int m,n;
double getdouble(void)
{
double a;
while(1)
{
cin >> a;
if(cin)
break;
cin.clear();
cin.ignore(1024,'\n');
cout<<"Error input, please input an double format number!"<<endl;
}
return a;
}
public:
matrix(const double *a,const int b,const int c)
{
p=new double[b*c];
m=b;
n=c;
memmove(p,a,sizeof(double)*b*c);
}
matrix(const char *a,const int