妈妈说 要把代码发给大家看看 持续更新
# include "iostream"class water
{
public:
void getcd (double a);
void sexcd (double a);
void sexdcd (double a);
void putcd ();
void putcc ();
water (double c, double m, double a, double x, double l);
private:
double cd, mj, ax;
double xq, lq;
};
void water::getcd (double a)
{
cd = a;
sexcd (cd);
sexdcd (cd);
}
void water::sexcd (double a)
{
xq = ((a + 6) * 3.141592654) * 35;
}
void water::sexdcd (double a)
{
lq = ((3.141592654 * (((a+6)/2)*((a+6)/2))) - (3.141592654 * ((a/2) * (a/2)))) * 20;
}
void water::putcc ()
{
std::cout <<" 线钱 = "<< xq <<"/n";
}
void water::putcd ()
{
std::cout <<" 路钱 = "<< lq <<"/n";
}
water::water(double c, double m, double a, double x, double l)
{
cd = c;
mj = m;
ax = a;
xq = x;
lq = l;
}
int main (void)
{
double k;
water one (0,0,0,0,0);
std::cin >> k;
one.getcd (k);
one.putcc ();
one.putcd ();
std::cin >> k;
return 0;
}
没有注释 大楷意思就是 游泳池。。 大圆套小圆 小圆自己输入。求 价钱的。。。 就怪我懒吧