编写函数double rect-area(double length,double width=0),
编写函数double rect-area(double length,double width=0):当width=0时计算正方形面积,否则计算长方形面积
人气:446 ℃ 时间:2020-09-25 15:25:19
解答
double rect_area(double length,double width=0){
if(width==0.0) width=length;
return length*width;
}
推荐
猜你喜欢
- 已知直线l:(2m^2+m-3)x+(m^2-m)-4m+1=0,m为何值时,l与x轴平行.当m为何值时,l在x轴上的截距等于1.
- 两个因数的积是450,一个因数的缩小到五分之一,要是几不变,另一个应该是几?
- 当X取何值时,化简式子2/3-5y-5后可得以个一次单项式
- 声音“震耳欲聋”,这是它的( ) A.响度很大 B.频率很高 C.振动幅度很大 D.分贝值很大
- 用直接开平方法接方程(x+2)²=m-4
- 证明:菱形的两条角线交点到一组邻居边的距离相等
- 一本书共120页,已经读了全书的2分之5,余下的计划6天读完.平均每天要读这本书的几分之几
- please do your homework,Danny.(否定句)