新手,希望大家多多指教!敬上一个小程序
请指教:class Crectangle
{
public:
Crectangle(double len=0,double wid=0);
virtual ~Crectangle();
void Set_data(double r,double h){r=len,wid=h;}
double Calctotallength(){totallength=2*(wid+len);}
double Calcarea(){area=wid*len;}
void Getdate()
{return len;
return wid;
}
void Initdate(double k,double j){r=k,h=j;}
vid Output
{
cout<<"length is"<<len<<"wid is"<<wid<<"totallength is"<<totallength<<"area is"<<area<<endl;
}
#include<iostream.h>
#include"rectangle.h"
#include<nath.h>
void main()
{
cout<<"请多多指教啊 "<<endl;
Crectangle myrectangle;
myrectangle.Set_date(2.0,3.0)
myrectangle.calctotalength()
myrectangle.calcarea()
myrectangle.output()
return 0;
}
希望各位“无情的”指出各种不足之处。这厢有礼了