大家帮忙修改程序的错误
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 15:19:37
大家帮忙修改程序的错误
#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,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
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
#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