> 数学 >
编写函数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;
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版