初学者,想问下用cin输入长宽高不行吗
#include<iostream>
using namespace std;
class cube
{ public:
//设置长
void setL(int l)
{
a-l=l;
}
//获取长
int getL()
{
}
void setw(int w)
{
a-w=w;
}
int getw()
{
}
void seth(int h)
{
a-h=h;
}
int geth()
{
}
int cubearea()
{
return 2*(a-l*a-w+a-l*a-h+a-w*a-h);
}
int cubevolume()
{
return a-l*a-h*a-w;
}
private:
int a-l;
int a-w
int a-h;
}
int main()
{ cube cabe007;
cube007.setl(20);
cube007.setw(30);
cube007.seth(30);
cout<<cube007.cubearea()<<endl;
cout<<cube007.cubevolume()<<endl;
system(“pause”);
}