大家帮忙修改程序的错误#include"iostream"using namespace std;const CN=35;const AN=20;class rectangle{public:rectangle(int ,int );int circumference();int area();virtual void display();protected:int len;int high;}rectangle::rectangle(int l,in
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/26 16:59:57
![大家帮忙修改程序的错误#include](/uploads/image/z/11621987-35-7.jpg?t=%E5%A4%A7%E5%AE%B6%E5%B8%AE%E5%BF%99%E4%BF%AE%E6%94%B9%E7%A8%8B%E5%BA%8F%E7%9A%84%E9%94%99%E8%AF%AF%23include%22iostream%22using+namespace+std%3Bconst+CN%3D35%3Bconst+AN%3D20%3Bclass+rectangle%7Bpublic%3Arectangle%28int+%2Cint+%29%3Bint+circumference%28%29%3Bint+area%28%29%3Bvirtual+void+display%28%29%3Bprotected%3Aint+len%3Bint+high%3B%7Drectangle%3A%3Arectangle%28int+l%2Cin)
大家帮忙修改程序的错误#include"iostream"using namespace std;const CN=35;const AN=20;class rectangle{public:rectangle(int ,int );int circumference();int area();virtual void display();protected:int len;int high;}rectangle::rectangle(int l,in
大家帮忙修改程序的错误
#include"iostream"
using namespace std;
const CN=35;
const AN=20;
class rectangle
{
public:
rectangle(int ,int );
int circumference();
int area();
virtual void display();
protected:
int len;
int high;
}
rectangle::rectangle(int l,int h)
{
len=l;
high=h;
}
int rectangle::circumference()
{
return (2*len+2*high);
}
int rectangle::area()
{
return (len*high);
}
void rectangle::display()
{
cout
大家帮忙修改程序的错误#include"iostream"using namespace std;const CN=35;const AN=20;class rectangle{public:rectangle(int ,int );int circumference();int area();virtual void display();protected:int len;int high;}rectangle::rectangle(int l,in
帮你改了一下下面注释的是有错的地方:
#include
using namespace std;
const int CN=35; //需要加上类型
const int AN=20; //同上
class rectangle
{
public:
rectangle();
rectangle(int,int);
int circumference();
int area();
virtual void display();
protected:
int len;
int high;
}; //分号掉了
rectangle::rectangle()
{len=0;
high=0;}
rectangle::rectangle(int l,int h)
{
len=l;
high=h;
}
int rectangle::circumference()
{
return (2*len+2*high);
}
int rectangle::area()
{
return (len*high);
}
void rectangle::display()
{
cout