主题:帮忙看一下这个怎么给
#include<iostream>
using namespace std;
class Box
{public:
Box();
Box(int,int);
int v();
protected:
int gao;
int chang;
};
Box::Box(int c,int k)
{
gao=c;
chang=k;
}
int Box::v()
{return(chang*gao);
}
class Box2: public Box
{ public:
get();
get(int m,int n);
int s();
};
Box2::get(int m,int n)
{ gao=m;
chang=n;
}
int Box2::s()
{ return(chang/gao);}
int main()
{while(1){
int a,b;
cin>>a>>b;
Box b1(a,b);
cout<<b1.v();
int m,n;
cin>>m>>n;
Box2 b2(3,1);
cout<<b2.s();
}
return 0;
}
using namespace std;
class Box
{public:
Box();
Box(int,int);
int v();
protected:
int gao;
int chang;
};
Box::Box(int c,int k)
{
gao=c;
chang=k;
}
int Box::v()
{return(chang*gao);
}
class Box2: public Box
{ public:
get();
get(int m,int n);
int s();
};
Box2::get(int m,int n)
{ gao=m;
chang=n;
}
int Box2::s()
{ return(chang/gao);}
int main()
{while(1){
int a,b;
cin>>a>>b;
Box b1(a,b);
cout<<b1.v();
int m,n;
cin>>m>>n;
Box2 b2(3,1);
cout<<b2.s();
}
return 0;
}