求高手解答哪里错了Cpp1.cpp(50) : fatal error C1004: unexpected end of file found
#include<iostream.h>classArea{protected:doubleheight;doublewidth;public:doubleset(dou...
#include<iostream.h>
class Area
{
protected:
double height;
double width;
public:
double set(double m,double n){
height=m;
width=n;
}
};
class Box:public Area {
public:
void juxing(double m,double n){
cout<<"矩形的面积"<<m*n;
}
};
class Isosceles:public Area{
public:
void sanjiaoxing(double m,double n){
cout<<"矩形的面积"<<(m*n)/2;
}
void main(){
double m,n;
cout<<"现在计算矩形的面积,请输入长和宽"<<endl<<"长为:";
cin>>m;
cout<<"宽为";
cin>>n;
Box s;
s.set();
s.juxing();
cout<<"现在计算三角形的面积,请输入底和高"<<endl<<"长为:";
cin>>m;
cout<<"底为";
cin>>n;
Isosceles x;
x.set();
x.sanjiaoxing();
} 展开
class Area
{
protected:
double height;
double width;
public:
double set(double m,double n){
height=m;
width=n;
}
};
class Box:public Area {
public:
void juxing(double m,double n){
cout<<"矩形的面积"<<m*n;
}
};
class Isosceles:public Area{
public:
void sanjiaoxing(double m,double n){
cout<<"矩形的面积"<<(m*n)/2;
}
void main(){
double m,n;
cout<<"现在计算矩形的面积,请输入长和宽"<<endl<<"长为:";
cin>>m;
cout<<"宽为";
cin>>n;
Box s;
s.set();
s.juxing();
cout<<"现在计算三角形的面积,请输入底和高"<<endl<<"长为:";
cin>>m;
cout<<"底为";
cin>>n;
Isosceles x;
x.set();
x.sanjiaoxing();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询