用c++ 定义一个圆类,计算圆的面积和周长.要求:分别用成员函数和友元函数来求圆的面积和周长.
用c++ 定义一个圆类,计算圆的面积和周长.要求:分别用成员函数和友元函数来求圆的面积和周长.
急用!
急用!
其他人气:414 ℃时间:2019-10-19 19:37:55
优质解答
#include class Circle{public:Circle():radius(0){}Circle(double r):radius(r){}const double area() const{return M_PI * radius * radius;}const double perimeter() const{return 2 * M_PI * radius;}friend do...
我来回答
类似推荐
猜你喜欢
- 1would you mind parking my car in front of your garden?=would you mind ____ ____ ____ my car in front of your garden?
- 2thank you for not smoking这种用法对吗
- 3一火车以2m/s的初速度,0.5m/s2的加速度做匀加速直线运动,求: (1)火车在第3s末的速度是多少? (2)在前4s的平均速度是多少? (3)在第5s的位移是多少? (4)在4s内的位移是多少?
- 4{5x-4y+4z=13 {2x+7y-3z=19 {3x+2y-z=18
- 5﹣3的平方-3×﹙﹣1﹚的立方﹣﹙﹣1﹚的4次方-﹙﹣5的平方﹚
- 62,I met her in the street the day before yesterday and she greeted me warmly.改为一般疑问句
- 7H2O2 和H2S反应 H2S 和H2SO4反应
- 8Why don't you piay basketball with us?的同义句
- 90既是整数,也是自然数._(判断对错).
- 10求导数!F(x)=∫ -9到sin(x) cos(t^2+t))dt 所以,F’(x)=?