正在加载图片...
例75“圆柱体”类成员函数的定义 void Cylinder: setcylinder(double r, double h) radIus-r, height=h; double cylinder: getradiuso return radius double cylinder: getheightO return height; double cylinder: volume double vol; vol=3. 1415926 radius*radius * height; return vol“圆柱体”类成员函数的定义 void Cylinder::setcylinder(double r,double h) { radius=r; height=h; } double Cylinder::getradius() { return radius; } double Cylinder::getheight() { return height; } double Cylinder:: volume() { double vol; vol=3.1415926*radius*radius*height; return vol; } 例 7.5
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有