作业帮 > 数学 > 作业

编写函数double rect-area(double length,double width=0),

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:数学作业 时间:2024/05/05 10:54:44
编写函数double rect-area(double length,double width=0),
编写函数double rect-area(double length,double width=0):当width=0时计算正方形面积,否则计算长方形面积
编写函数double rect-area(double length,double width=0),
double rect_area(double length,double width=0){
if(width==0.0) width=length;
return length*width;
}