#include <iostream>
using namespace std;
class cube
{
public:
void setL(int l)
{
int m_L = l;
}
int getL()
{
return m_L;
}
void setW(int w)
{
int m_W = w;
}
int getW()
{
return m_W;
}
void setH(int h)
{
int m_H = h;
}
int getH()
{
return m_H;
}
int calculateS()
{
return (m_L * m_W + m_L * m_H + m_W * m_H)*2;
}
int calculateV()
{
return m_L* m_H* m_W;
}
private:
int m_L;
int m_W;
int m_H;
};
int main()
{
cube c1;
c1.setL(10);
c1.setW(10);
c1.setH(10);
cout << "c1的面积是" <<c1.calculateS()<< endl;
cout << "c1的体积是" << c1.calculateV() << endl;
system("pause");
return 0;
}
using namespace std;
class cube
{
public:
void setL(int l)
{
int m_L = l;
}
int getL()
{
return m_L;
}
void setW(int w)
{
int m_W = w;
}
int getW()
{
return m_W;
}
void setH(int h)
{
int m_H = h;
}
int getH()
{
return m_H;
}
int calculateS()
{
return (m_L * m_W + m_L * m_H + m_W * m_H)*2;
}
int calculateV()
{
return m_L* m_H* m_W;
}
private:
int m_L;
int m_W;
int m_H;
};
int main()
{
cube c1;
c1.setL(10);
c1.setW(10);
c1.setH(10);
cout << "c1的面积是" <<c1.calculateS()<< endl;
cout << "c1的体积是" << c1.calculateV() << endl;
system("pause");
return 0;
}