class Rect{private:float length,width;public:void set(float x,float y);float peri();float area();};void Rect::set(float x,float y){length=x;width=y;}float Rect::peri(){return (length+width)*2;}float Rect::area(){return(length*width);}void main(){Rect r;r.set(1.0f,2.0f);r.peri();r.area();}
- 1 回答
- 1 关注
- 1640 浏览
添加回答
举报
0/150
提交
取消