求答案c++
111111111111111111111111111111111111111
根据main函数,类名应该是form
#include <iostream>
using namespace std;
class form
{
private:
int m_length;
int m_width;
int m_height;
int m_squareLength;
public:
void inputCuboid()
{
cin>>m_length;
cin>>m_width;
cin>>m_height;
}
int getCuboidArea()
{
return 2*(m_length*m_width+m_length*m_height + m_width*m_height);
}
int getSquareArea()
{
return 6*m_squareLength * m_squareLength;
}
int getSquareSide()
{
m_squareLength = 1;
while(getSquareArea() < getCuboidArea())
m_squareLength++;
return m_squareLength;
}
};
int main()
{
form oneform;
oneform.inputCuboid();
cout<<oneform.getSquareSide()<<endl;
return 0;
}